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

Try to fix Nushell install #2444

Merged
merged 1 commit into from Nov 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Expand Up @@ -45,8 +45,8 @@ jobs:
${{ runner.os == 'Linux' && 'sudo apt-get install curl wget -y' || true }} && \
${{ runner.os == 'Linux' && 'nushell_url=$(curl -s https://api.github.com/repos/nushell/nushell/releases/latest | grep "browser_" | grep "x86_64" | grep "linux" | grep "gnu" | cut -d\" -f4 )' || true }} && \
${{ runner.os == 'Linux' && 'wget -O nushell.tar.gz $nushell_url' || true }} && \
${{ runner.os == 'Linux' && 'tar -zxf --strip-components=1 nushell.tar.gz' || true }} && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems easier to just make this

tar -zxf nushell.tar.gz --strip-components=1

instead of trying to glob the file path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was tried before but didn't work

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a very important order of arguments. GNU Tar requires a filename immediately after -f. Currently --strip-components=1 is being interpreted as a filename and is invalid. it needs to be placed after the filename or before the other arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem with pattern matching is that if the triplet changes, this will break again. using --strip-components obviates that.

just my $.02

${{ runner.os == 'Linux' && 'sudo cp nu /usr/bin' || true }} && \
${{ runner.os == 'Linux' && 'tar -zxf nushell.tar.gz' || true }} && \
${{ runner.os == 'Linux' && 'sudo cp nu-*-x86_64-unknown-linux-gnu/nu /usr/bin' || true }} && \
${{ runner.os == 'Windows' && 'choco install nushell' || true }} && \
${{ runner.os == 'macOS' && 'brew install fish tcsh nushell' || true }} && \
exit 0 || true;
Expand Down