File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ if [ -z "$1" ]; then
5
5
exit 1;
6
6
fi
7
7
8
+ if [ ! -f " $1 " ]; then
9
+ (>&2 echo " $1 No such file or directory" )
10
+ exit 2;
11
+ fi
12
+
8
13
grep -o " {container.env.[a-zA-Z0-9_]\+}" $1 | while read -r GREPRESULT ; do
9
14
# Remove the {container.env.} from the grep result
10
15
ENVNAME=$( echo $GREPRESULT | cut -c16- | rev | cut -c2- | rev)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,6 +30,14 @@ setup () {
30
30
31
31
@test " Replacing a dead_symlink" {
32
32
FILE=$BATS_RUN_DIR /files/dead_symlink
33
+ ln -s $BATS_RUN_DIR /files/does_not_exists $FILE
34
+ run /bin/sh $BATS_BINARY_DIR /instateEnvironment.sh $FILE
35
+ assert_failure
36
+ rm -rf $FILE
37
+ }
38
+
39
+ @test " Replacing a non existing file" {
40
+ FILE=$BATS_RUN_DIR /files/does_not_exist
33
41
run /bin/sh $BATS_BINARY_DIR /instateEnvironment.sh $FILE
34
42
assert_failure
35
43
}
You can’t perform that action at this time.
0 commit comments