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: installation without sudo #8715

Merged
merged 2 commits into from
Feb 16, 2022
Merged
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
6 changes: 4 additions & 2 deletions cmd/ipfs/dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
INSTALL_DIR=$(dirname $0)

bin="$INSTALL_DIR/ipfs"
binpaths="/usr/local/bin /usr/bin"
binpaths='/usr/local/bin /usr/bin $HOME/.local/bin'

# This variable contains a nonzero length string in case the script fails
# because of missing write permissions.
is_write_perm_missing=""

for binpath in $binpaths; do
for raw in $binpaths; do
# Expand the $HOME variable.
binpath=$(eval echo "$raw")
if mv "$bin" "$binpath/ipfs" ; then
echo "Moved $bin to $binpath"
exit 0
Expand Down