Skip to content

Commit

Permalink
run.sh: Check for spaces in the path to the current directory.
Browse files Browse the repository at this point in the history
The shell wrapper script for the ODK is assuming that the directory
containing the repository does not contain spaces in its path. This is
required for the logic that binds the repository to the /work directory
inside the container to work, and we may not change that without
breaking the requirement that the wrapper script shall be POSIX
compliant (supporting space-containing paths would require using
array-typed variables, which are not specified by POSIX).

This commit adds an explicit check at the beginning of the wrapper
script to ensure that the current working directory does not contain any
spaces, and immediately abort if it does.

closes #1078
  • Loading branch information
gouttegd committed Jun 29, 2024
1 parent fc0432f commit ed54e84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions template/src/ontology/run.sh.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

set -e

# Check for spaces in the current directory path
for item in $PWD ; do
if [ "$item" != "$PWD" ]; then
echo "${0##*/}: error: repository path must not contain whitespace characters" >&2
exit 1
fi
done

if [ -f run.sh.conf ]; then
. ./run.sh.conf
fi
Expand Down

0 comments on commit ed54e84

Please sign in to comment.