Skip to content

Commit

Permalink
fix the Windows path to Nupm's install root
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Oct 16, 2023
1 parent 37a97f1 commit ffde4dd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ jobs:
echo "ARCH=x86_64-linux-gnu-full" >> $GITHUB_ENV
echo "EXT=tar.gz" >> $GITHUB_ENV
echo "NU_BIN=nu" >> $GITHUB_ENV
echo "NUPM=$HOME/nupm" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "Windows" ]; then
echo "ARCH=x86_64-pc-windows-msvc" >> $GITHUB_ENV
echo "EXT=zip" >> $GITHUB_ENV
echo "NU_BIN=nu.exe" >> $GITHUB_ENV
# NOTE: for some reason, `$HOME` gives an incorrect path on Windows, e.g. it looks like
# `/c/Users/runneradmin` where it should really be `c:\Users\runneradmin`: this commands
# changes the `/` into `\` and replaces the first part of the path with "x:\"
echo "NUPM=$(echo $HOME | tr '/' '\\' | sed 's/^\\\(.\)\\/\1:\\/')/nupm" >> $GITHUB_ENV
elif [ "${{ runner.os }}" = "macOS" ]; then
echo "ARCH=x86_64-apple-darwin" >> $GITHUB_ENV
echo "EXT=tar.gz" >> $GITHUB_ENV
echo "NU_BIN=nu" >> $GITHUB_ENV
echo "NUPM=$HOME/nupm" >> $GITHUB_ENV
fi
- name: Install Nushell from Nightly
Expand All @@ -59,12 +65,12 @@ jobs:
cp "/tmp/$name/${{ env.NU_BIN }}" "$HOME/${{ env.NU_BIN }}"
- name: Install Nupm from Source
run: git clone https://github.com/nushell/nupm $HOME/nupm
run: git clone https://github.com/nushell/nupm "${{ env.NUPM }}/nupm"

- name: Show Nushell Version
run: |
"$HOME/${{ env.NU_BIN }}" --commands "version"
- name: Run the tests
run: |
"$HOME/${{ env.NU_BIN }}" --commands "use $HOME/nupm/nupm/; nupm test"
"$HOME/${{ env.NU_BIN }}" --commands "use ${{ env.NUPM }}/nupm/; nupm test"

0 comments on commit ffde4dd

Please sign in to comment.