Skip to content

Commit 0256519

Browse files
committed
Fix: Accept directory names with spaces for artifacts, sources and buildspec
1 parent 123267a commit 0256519

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

local_builds/codebuild_build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,19 @@ else
100100
fi
101101

102102
docker_command+="\"IMAGE_NAME=$image_name\" -e \
103-
\"ARTIFACTS=$(allOSRealPath $artifact_dir)\""
103+
\"ARTIFACTS=$(allOSRealPath "$artifact_dir")\""
104104

105105
if [ -z "$source_dirs" ]
106106
then
107-
docker_command+=" -e \"SOURCE=$(allOSRealPath $PWD)\""
107+
docker_command+=" -e \"SOURCE=$(allOSRealPath "$PWD")\""
108108
else
109109
for index in "${!source_dirs[@]}"; do
110110
if [ $index -eq 0 ]
111111
then
112-
docker_command+=" -e \"SOURCE=$(allOSRealPath ${source_dirs[$index]})\""
112+
docker_command+=" -e \"SOURCE=$(allOSRealPath "${source_dirs[$index]}")\""
113113
else
114114
identifier=${source_dirs[$index]%%:*}
115-
src_dir=$(allOSRealPath ${source_dirs[$index]#*:})
115+
src_dir=$(allOSRealPath "${source_dirs[$index]#*:}")
116116

117117
docker_command+=" -e \"SECONDARY_SOURCE_$index=$identifier:$src_dir\""
118118
fi
@@ -121,7 +121,7 @@ fi
121121

122122
if [ -n "$buildspec" ]
123123
then
124-
docker_command+=" -e \"BUILDSPEC=$(allOSRealPath $buildspec)\""
124+
docker_command+=" -e \"BUILDSPEC=$(allOSRealPath "$buildspec")\""
125125
fi
126126

127127
if [ -n "$environment_variable_file" ]
@@ -182,4 +182,4 @@ echo ""
182182
echo $exposed_command
183183
echo ""
184184

185-
eval $docker_command
185+
eval $docker_command

0 commit comments

Comments
 (0)