Skip to content

Commit acb15ea

Browse files
committed
Fix [ -z $var clauses without quotes
1 parent e1ad6c0 commit acb15ea

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/dpl/provider/atlas.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Atlas < Provider
1616
chmod +x $HOME/bin/gimme
1717
fi
1818
19-
if [ -z $GOPATH ]; then
19+
if [ -z "$GOPATH" ]; then
2020
export GOPATH="$HOME/gopath"
2121
else
2222
export GOPATH="$HOME/gopath:$GOPATH"

lib/dpl/provider/pypi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def pypi_wheel_arg
6767

6868
def install_deploy_dependencies
6969
# --user likely fails inside virtualenvs but is needed outside to avoid needing sudo.
70-
unless context.shell "if [ -z ${VIRTUAL_ENV+x} ]; then export PIP_USER=yes; fi && " \
70+
unless context.shell "if [ -z \"${VIRTUAL_ENV}\" ]; then export PIP_USER=yes; fi && " \
7171
"wget -nv -O - https://bootstrap.pypa.io/get-pip.py | python - --no-setuptools --no-wheel && " \
7272
"pip install --upgrade #{pypi_setuptools_arg} #{pypi_twine_arg} #{pypi_wheel_arg}"
7373
error "Couldn't install pip, setuptools, twine or wheel."

spec/provider/pypi_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
describe "#install_deploy_dependencies" do
1010
example do
1111
expect(provider.context).to receive(:shell).with(
12-
"if [ -z ${VIRTUAL_ENV+x} ]; then export PIP_USER=yes; fi && wget -nv -O - https://bootstrap.pypa.io/get-pip.py | python - --no-setuptools --no-wheel && pip install --upgrade setuptools twine wheel"
12+
"if [ -z \"${VIRTUAL_ENV}\" ]; then export PIP_USER=yes; fi && wget -nv -O - https://bootstrap.pypa.io/get-pip.py | python - --no-setuptools --no-wheel && pip install --upgrade setuptools twine wheel"
1313
).and_return(true)
1414
provider.install_deploy_dependencies
1515
end
@@ -21,7 +21,7 @@
2121
provider.options.update(:twine_version => '1.1.0')
2222
provider.options.update(:wheel_version => '0.1.0')
2323
expect(provider.context).to receive(:shell).with(
24-
"if [ -z ${VIRTUAL_ENV+x} ]; then export PIP_USER=yes; fi && wget -nv -O - https://bootstrap.pypa.io/get-pip.py | python - --no-setuptools --no-wheel && pip install --upgrade setuptools==1.0.1 twine==1.1.0 wheel==0.1.0"
24+
"if [ -z \"${VIRTUAL_ENV}\" ]; then export PIP_USER=yes; fi && wget -nv -O - https://bootstrap.pypa.io/get-pip.py | python - --no-setuptools --no-wheel && pip install --upgrade setuptools==1.0.1 twine==1.1.0 wheel==0.1.0"
2525
).and_return(true)
2626
provider.install_deploy_dependencies
2727
end

0 commit comments

Comments
 (0)