-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ensure that folder exists before moving ipfs binary. #8934
Ensure that folder exists before moving ipfs binary. #8934
Conversation
cmd/ipfs/dist/install.sh
Outdated
@@ -15,6 +15,7 @@ is_write_perm_missing="" | |||
for raw in $binpaths; do | |||
# Expand the $HOME variable. | |||
binpath=$(eval echo "$raw") | |||
mkdir -p $binpath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p $binpath | |
mkdir -p "$binpath" |
(need to quote in case there's a space in the path)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p $binpath | |
mkdir -p ${binpath} |
Use ${}
syntax in case there is a space and a quote in the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expansion needs to be quoted to protect against spaces, even when using curly braces. In this case, the curly braces are equivalent and just a style preference. So it needs to be either "$binpath"
or "${binpath}"
(I don't really care which), but not $binpath
nor ${binpath}
.
9b29d70
to
09d7c13
Compare
On macOS Monterey there is no /usr/local/bin folder and we need to create it.
09d7c13
to
7e488c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit ae15e18)
(cherry picked from commit ae15e18)
(cherry picked from commit ae15e18)
On macOS Monterey there is no
/usr/local/bin
folder and we need to create it.Closes #8347.