mirror of
https://github.com/fsquillace/junest.git
synced 2026-07-25 03:47:03 +00:00
Merge pull request #287 from neiser/master
Fix quoting in wrapper script
This commit is contained in:
commit
5630a0f035
1 changed files with 7 additions and 7 deletions
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
|
||||
function create_wrappers() {
|
||||
mkdir -p ${JUNEST_HOME}/usr/bin_wrappers
|
||||
mkdir -p "${JUNEST_HOME}/usr/bin_wrappers"
|
||||
|
||||
cd ${JUNEST_HOME}/usr/bin
|
||||
cd "${JUNEST_HOME}/usr/bin" || return 1
|
||||
for file in *
|
||||
do
|
||||
[[ -x $file ]] || continue
|
||||
|
|
@ -14,21 +14,21 @@ function create_wrappers() {
|
|||
# Arguments inside a variable (i.e. `JUNEST_ARGS`) separated by quotes
|
||||
# are not recognized normally unless using `eval`. More info here:
|
||||
# https://github.com/fsquillace/junest/issues/262
|
||||
cat <<EOF > ${JUNEST_HOME}/usr/bin_wrappers/${file}
|
||||
cat <<EOF > "${JUNEST_HOME}/usr/bin_wrappers/${file}"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
JUNEST_ARGS=\${JUNEST_ARGS:-ns --fakeroot}
|
||||
|
||||
eval junest \${JUNEST_ARGS} -- ${file} "\$@"
|
||||
eval junest "\${JUNEST_ARGS}" -- ${file} "\$(printf "%q" "\$@")"
|
||||
EOF
|
||||
chmod +x ${JUNEST_HOME}/usr/bin_wrappers/${file}
|
||||
chmod +x "${JUNEST_HOME}/usr/bin_wrappers/${file}"
|
||||
done
|
||||
|
||||
# Remove wrappers no longer needed
|
||||
cd ${JUNEST_HOME}/usr/bin_wrappers
|
||||
cd "${JUNEST_HOME}/usr/bin_wrappers" || return 1
|
||||
for file in *
|
||||
do
|
||||
[[ -e ${JUNEST_HOME}/usr/bin/$file ]] || rm -f $file
|
||||
[[ -e ${JUNEST_HOME}/usr/bin/$file ]] || rm -f "$file"
|
||||
done
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue