Skip to content

Commit b956ae5

Browse files
committed
escape more commands (see #57)
1 parent 764d891 commit b956ae5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

virtualenvwrapper.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ virtualenvwrapper_verify_workon_home () {
100100
virtualenvwrapper_tempfile () {
101101
# Note: the 'X's must come last
102102
typeset suffix=${1:-hook}
103-
typeset file="`mktemp -t virtualenvwrapper-$suffix-XXXXXXXXXX`"
103+
typeset file="`\mktemp -t virtualenvwrapper-$suffix-XXXXXXXXXX`"
104104
if [ $? -ne 0 ]
105105
then
106106
echo "ERROR: virtualenvwrapper could not create a temporary file name." 1>&2
@@ -233,7 +233,7 @@ virtualenvwrapper_show_workon_options () {
233233
# NOTE: DO NOT use ls here because colorized versions spew control characters
234234
# into the output list.
235235
# echo seems a little faster than find, even with -depth 3.
236-
(cd "$WORKON_HOME"; for f in */bin/activate; do echo $f; done) 2>/dev/null | sed 's|^\./||' | sed 's|/bin/activate||' | sort | (unset GREP_OPTIONS; \egrep -v '^\*$')
236+
(cd "$WORKON_HOME"; for f in */bin/activate; do echo $f; done) 2>/dev/null | \sed 's|^\./||' | \sed 's|/bin/activate||' | \sort | (unset GREP_OPTIONS; \egrep -v '^\*$')
237237
# (cd "$WORKON_HOME"; find -L . -depth 3 -path '*/bin/activate') | sed 's|^\./||' | sed 's|/bin/activate||' | sort
238238
}
239239

@@ -467,17 +467,17 @@ cpvirtualenv() {
467467
return 1
468468
fi
469469

470-
cp -r "$source_env" "$target_env"
471-
for script in $( ls $target_env/bin/* )
470+
\cp -r "$source_env" "$target_env"
471+
for script in $( \ls $target_env/bin/* )
472472
do
473473
newscript="$script-new"
474-
sed "s|$source_env|$target_env|g" < "$script" > "$newscript"
475-
mv "$newscript" "$script"
476-
chmod a+x "$script"
474+
\sed "s|$source_env|$target_env|g" < "$script" > "$newscript"
475+
\mv "$newscript" "$script"
476+
\chmod a+x "$script"
477477
done
478478

479479
virtualenv "$target_env" --relocatable
480-
sed "s/VIRTUAL_ENV\(.*\)$env_name/VIRTUAL_ENV\1$new_env/g" < "$source_env/bin/activate" > "$target_env/bin/activate"
480+
\sed "s/VIRTUAL_ENV\(.*\)$env_name/VIRTUAL_ENV\1$new_env/g" < "$source_env/bin/activate" > "$target_env/bin/activate"
481481

482482
(cd "$WORKON_HOME" &&
483483
virtualenvwrapper_run_hook "pre_cpvirtualenv" "$env_name" "$new_env" &&

0 commit comments

Comments
 (0)