-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Feature: Add one line install script and instructions to README #594
Conversation
install.sh
Outdated
@@ -0,0 +1,57 @@ | |||
#!/bin/sh | |||
|
|||
BIN_DIR=$(pwd) |
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.
It would be great to only set this if it isn't set, so people can do:
BIN_DIR=/usr/bin curl -sLK https://raw.githubusercontent.com/dunglas/frankenphp/main/install.sh | sh
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.
Thanks
Added 19c126a and d0962c8 so user can do export BIN_DIR=...
however still not setting /usr/bin
as default path because it may require sudo
as cat install.sh | sudo sh
, because not always /usr/bin
has the permissions for the user.
And adding extra instructions to set BIN_DIR
in the README kind of complicates this simple process. Although added provision so user can install elsewhere too. That is why, pwd
keeps things simple and user has a choice to move it to which ever bin dir of user's PATH choice.
Verification as below:
Fail
╰─$ sudo cat install.sh| sh
Password:
Warning: Failed to open the file /usr/local/bin/frankenphp: Permission denied
curl: (23) Failure writing output to destination
Success
╰─$ cat install.sh| sudo sh
Password:
######################################################################## 100.0%
Installed successfully to: /usr/local/bin/frankenphp
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.
Overall LGTM and I like it.
Looks like some issues with shellcheck in GHA (mostly variables need to be quoted). Can you address that? |
Thanks for the review @withinboredom |
Ideally it'd be also nice to have this script hosted on |
There are still remaining issues (double quoting to prevent globbing). The paths should be quoted because if my current pwd is |
e3fbf09
to
5a0f3b2
Compare
Squashed commits and lints fixed. |
Is this safe? Composer uses a checksum for instance: https://getcomposer.org/download/ |
No comments on this. |
Incomplete downloads, bad actors/broken caches on corporate middle-boxes, and a host of other things can cause checksums to be invalid. It's worth detecting it if we can, if for no other reason than to save people some time when things aren't working as expected. |
It is worth detecting. Yes. Just for this install script it seems over work. And may not have a simple straightforward command for the user. It’s a trade off. |
Ok, that works for me. That would be nice to have an official brew and maybe APT repositories too (easier to update). |
Yes. Given the popularity of this tool it’d be at least wise to reserve the names on brew and/or apt get etc. Publications can be delayed when you have time. Suggestion is to at least own the name before some bots started claiming it. It is just a naive thought. |
Hello, They are remaining tasks to do before merging this PR ? Would be great to have this in the README.md file |
I believe this is ready. All changes from my side have been pushed. |
install.sh
Outdated
|
||
THE_ARCH_BIN="" | ||
THIS_PROJECT_OWNER="dunglas" | ||
DEST=$BIN_DIR/frankenphp |
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.
Why not install directly the binary in /usr/local/bin/
? This will simplify the one-liner provided in docs.
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.
I think that change makes an assumption that there is a /usr/local/bin
to install to or that the user has permissions to do so. I, personally, would be wary of running a random curl'd script with root permissions just to install something.
I think you can probably make the docs more readable by suggesting BIN_DIR
:
curl -sLK https://raw.githubusercontent.com/dunglas/frankenphp/main/install.sh | BIN_DIR=/usr/local/bin sh
and modify the script prompt for sudo
if it fails to copy.
install.sh
Outdated
|
||
THE_ARCH_BIN="" | ||
THIS_PROJECT_OWNER="dunglas" | ||
DEST=$BIN_DIR/frankenphp |
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.
I think that change makes an assumption that there is a /usr/local/bin
to install to or that the user has permissions to do so. I, personally, would be wary of running a random curl'd script with root permissions just to install something.
I think you can probably make the docs more readable by suggesting BIN_DIR
:
curl -sLK https://raw.githubusercontent.com/dunglas/frankenphp/main/install.sh | BIN_DIR=/usr/local/bin sh
and modify the script prompt for sudo
if it fails to copy.
…s to current directory
Co-authored-by: Rob Landers <[email protected]>
Thank you @kevincobain2000! I refactored a bit the script. |
Thanks! |
Install cli could be more convinient for for users to not guess b/w
arm
,x86_64
andaarch
etc..Plus it will provide better installation for dev-ops team as one interface.
Verify