Skip to content

Commit

Permalink
fix(sh): use correct args for dotnet-install (automotiveMastermind#46)
Browse files Browse the repository at this point in the history
* resolve an issue with the `--channel` argument in `dotnet-install`
* resolve an issue with the `--version` argument in `dotnet-install`
* add tests for `dotnet-install` and apply to macos build in circle-ci

Closes: automotiveMastermind#45
  • Loading branch information
dmccaffery committed Jan 14, 2020
1 parent e2b39f3 commit 8a2b5e3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
xcode: "11.2.1"
steps:
- checkout
- run:
name: test
command: ./test.sh
- run:
name: install-bash
command: ./install.sh bash | tee log.txt && bash -lc "git sha"
Expand Down
4 changes: 2 additions & 2 deletions src/sh/scripts/dotnet-install
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ __am_prompt_dotnet_install() {
__am_prompt_safe_exec chmod +x "$DOTNET_INSTALL_SH"

for DOTNET_VERSION in $DOTNET_VERSIONS; do
__am_prompt_safe_exec "$DOTNET_INSTALL_SH" __version $DOTNET_VERSION
__am_prompt_safe_exec "$DOTNET_INSTALL_SH" --version $DOTNET_VERSION
done

for DOTNET_CHANNEL in $DOTNET_CHANNELS; do
__am_prompt_safe_exec "$DOTNET_INSTALL_SH" __channel $DOTNET_CHANNEL
__am_prompt_safe_exec "$DOTNET_INSTALL_SH" --channel $DOTNET_CHANNEL
done

mkdir -p /usr/local/share 1>/dev/null 2>&1
Expand Down
6 changes: 6 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

set -eu

# run the tests with a dummy terminal
TERM=dumb find ./test/sh/scripts -name '*.test.sh' -exec {} \;
13 changes: 13 additions & 0 deletions test/sh/scripts/dotnet-install.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh

set -eu

echo 'test default install'
./src/sh/scripts/dotnet-install

echo 'test channel install'
./src/sh/scripts/dotnet-install --channel lts

echo 'test version install'
./src/sh/scripts/dotnet-install --version latest

0 comments on commit 8a2b5e3

Please sign in to comment.