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

fix: installation without sudo #8715

merged 2 commits into from
Feb 16, 2022

Conversation

vmx
Copy link
Member

@vmx vmx commented Feb 4, 2022

I think it's good practice that users don't need to run sudo
to install something just to try it out. With this change, the
local bin directory is tried first, which usually is also in the
PATH. This way the installation script can be run without
sudo and should still work.

I think it's good practice that users don't need to run `sudo`
to install something just to try it out. With this change, the
local bin directory is tried first, which usually is also in the
`PATH`. This way the installation script can be run without
`sudo` and should still work.
@welcome
Copy link

welcome bot commented Feb 4, 2022

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@@ -6,7 +6,7 @@
INSTALL_DIR=$(dirname $0)

bin="$INSTALL_DIR/ipfs"
binpaths="/usr/local/bin /usr/bin"
binpaths="$HOME/.local/bin /usr/local/bin /usr/bin"
Copy link
Contributor

@guseggert guseggert Feb 15, 2022

Choose a reason for hiding this comment

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

Can we put this at the end of the list so that it's backwards compatible? (i.e. if you run w/ sudo it will continue to put the bin in the same place)

Suggested change
binpaths="$HOME/.local/bin /usr/local/bin /usr/bin"
binpaths="/usr/local/bin /usr/bin $HOME/.local/bin"

Copy link
Contributor

Choose a reason for hiding this comment

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

Also will this work if $HOME has a space in it?

Copy link
Member Author

Choose a reason for hiding this comment

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

@guseggert thanks for the review, the new commit should fix the issues you've mentioned.

Try the `$HOME/.local/bin` path last, so that the script is backwards
compatible. Also make sure that it works even if there are spaces in
the directory set by `$HOME`.
@guseggert guseggert merged commit a049ba9 into ipfs:master Feb 16, 2022
@vmx vmx deleted the patch-1 branch February 16, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants