Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [ -z $var clauses without quotes #1161

Open
wants to merge 2 commits into
base: v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/dpl/provider/atlas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Atlas < Provider
chmod +x $HOME/bin/gimme
fi

if [ -z $GOPATH ]; then
if [ -z "$GOPATH" ]; then
export GOPATH="$HOME/gopath"
else
export GOPATH="$HOME/gopath:$GOPATH"
Expand Down
2 changes: 1 addition & 1 deletion lib/dpl/provider/pypi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def pypi_wheel_arg
def install_deploy_dependencies
# --user likely fails inside virtualenvs but is needed outside to avoid needing sudo.
# `--upgrade-strategy eager` prevents the old resolver from keeping an outdated dependency if it's preinstalled
unless context.shell "if [ -z ${VIRTUAL_ENV+x} ]; then export PIP_USER=yes; fi && " \
unless context.shell "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 --upgrade-strategy eager #{pypi_setuptools_arg} #{pypi_twine_arg} #{pypi_wheel_arg}"
error "Couldn't install pip, setuptools, twine or wheel."
Expand Down
4 changes: 2 additions & 2 deletions spec/provider/pypi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
describe "#install_deploy_dependencies" do
example do
expect(provider.context).to receive(:shell).with(
"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 --upgrade-strategy eager setuptools twine wheel"
"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 --upgrade-strategy eager setuptools twine wheel"
).and_return(true)
provider.install_deploy_dependencies
end
Expand All @@ -21,7 +21,7 @@
provider.options.update(:twine_version => '1.1.0')
provider.options.update(:wheel_version => '0.1.0')
expect(provider.context).to receive(:shell).with(
"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 --upgrade-strategy eager setuptools==1.0.1 twine==1.1.0 wheel==0.1.0"
"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 --upgrade-strategy eager setuptools==1.0.1 twine==1.1.0 wheel==0.1.0"
).and_return(true)
provider.install_deploy_dependencies
end
Expand Down