Skip to content
This repository was archived by the owner on Sep 1, 2019. It is now read-only.

Conversation

@AlexDaniel
Copy link

To support any paths that contain spaces or start with -. Also,
removes nonsensical use of ${} because it does nothing anyway.

To support any paths that contain spaces or start with -. Also,
removes nonsensical use of ${} because it does nothing anyway.
@AlexDaniel AlexDaniel changed the title [WIP] Proper shell quoting Proper shell quoting Jan 24, 2018
@AlexDaniel
Copy link
Author

This is probably good to go. I haven't tested it so someone else will probably need to confirm that nothing is broken.

@stmuk
Copy link
Owner

stmuk commented Jan 24, 2018

Not very keen on merging if we don't know it works. I also prefer ${} as less ambiguous in some cases.

I'll use your PR to finish quoting the bash variables anyway so thanks for that

# https://github.com/stmuk/rakudup

RAKUDO_ROOT="${HOME}/.rakudup"
RAKUDO_ROOT=$HOME/.rakudup
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove "" here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need really, just for consistency with the other line below.

then
set -x
if [[ $DEBUG ]]; then
set -x
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks DEBUG=0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You sure it does?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I think it would have to be [ $DEBUG ] since [[ 0 ]] is [ "0" ] which is true.

I now remember why I use Perl! grrrr

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEBUG=0
if [[ $DEBUG ]]; then echo foo; fi       # foo
if [ ! -z "$DEBUG" ]; then echo bar; fi  # bar

Looks identical to me

cd ${RAKUDO_SRC}
echo "Building Rakudo ${RELEASE}. This will take several minutes on a modern CPU."
echo "'tail -f ${RAKUDO_SRC}/build.log' for progress"
cd -- "$RAKUDO_SRC" || exit 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add the exit but don't care about the case where directory starts with dash! (Although it is interesting!)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? But that's the whole point…

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants