Skip to content

Commit 381c733

Browse files
authored
Fix sed command that breaks on linux (#545)
* fix sed command that breaks on linux * fixing rm error
1 parent e32e8cc commit 381c733

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

integration_test/run_tests.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ function build_sdk {
4141
function pick_node8 {
4242
cd "${DIR}"
4343
cp package.node8.json functions/package.json
44-
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
44+
# we have to do the -e flag here so that it work both on linux and mac os, but that creates an extra
45+
# backup file called package.json-e that we should clean up afterwards.
46+
sed -i -e "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
47+
rm -f functions/package.json-e
4548
}
4649

4750
function pick_node10 {
4851
cd "${DIR}"
4952
cp package.node10.json functions/package.json
50-
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
53+
# we have to do the -e flag here so that it work both on linux and mac os, but that creates an extra
54+
# backup file called package.json-e that we should clean up afterwards.
55+
sed -i -e "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
56+
rm -f functions/package.json-e
5157
}
5258

5359
function install_deps {
@@ -101,7 +107,7 @@ function run_tests {
101107
function cleanup {
102108
announce "Performing cleanup..."
103109
delete_all_functions
104-
rm "${DIR}/functions/firebase-functions-*.tgz"
110+
rm "${DIR}/functions/firebase-functions-${TIMESTAMP}.tgz"
105111
rm "${DIR}/functions/package.json"
106112
rm -f "${DIR}/functions/firebase-debug.log"
107113
rm -rf "${DIR}/functions/lib"

0 commit comments

Comments
 (0)