-
Notifications
You must be signed in to change notification settings - Fork 844
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
Update this script so that it works on Linux. #1799
Conversation
Make `fd` the default name of the program, but allow for the user to specify another, such as `FD=fdfind scripts/update-version.sh`. Fix the sed command to take the filename to modify in-place and specify that the regex string is the sed-expression to execute.
@@ -1,12 +1,16 @@ | |||
#! /bin/sh | |||
|
|||
: "${FD:=fd}" |
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.
Do we really need this? (can we add a comment on how to install fd (via cargo and apt-get)
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.
On MacOS, fd
can also be installed using homebrew.
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 added this because when you install fd
with apt-get, the command is fdfind
. I assume we need to support both names, but I kept fd
as the default on the assumption that it was Debian renaming things. If fdfind
is the popular name, I can make that the default. Or, we can remove the default and use fdfind
unconditionally. Thoughts?
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.
fd
seems to be the right name to me. fd-find
being the name of the crate which provides the fd
CLI.
I think being able to change the name of the CLI is great to have. We ensure the script will work everywhere, whatever the path/name of the fd
CLI is.
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.
Works on MacOS after installing fd
and gnu-sed
with brew
.
@@ -1,12 +1,16 @@ | |||
#! /bin/sh | |||
|
|||
: "${FD:=fd}" |
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.
: "${FD:=fd}" | |
: # How to install `fd`: https://github.com/sharkdp/fd#installation | |
: "${FD:=fd}" |
It shouldn't need gnu-sed, bsd sed should work too? Does it not? |
@nlewycky unfortunately |
@jubianchi good call here, the script now doesn't work on mac 😆 I wrote this script as a hack in like 30 seconds a long time ago, maybe it's time to solve this problem properly 🤔 As for |
Make
fd
the default name of the program, but allow for the user to specify another, such asFD=fdfind scripts/update-version.sh
.Fix the sed command to take the filename to modify in-place and specify that the regex string is the sed-expression to execute.
Review