-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer shells automatically, and
use
versions based on the current w…
…orking directory (optional) (#68) * `use` on every `cd`, infer shell type * Add the ability to `use` on every pwd change (bash, zsh) * infers shell type automatically. Fixes #20
- Loading branch information
Showing
8 changed files
with
214 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env fish | ||
|
||
eval (fnm env --fish) | ||
fnm env --fish | source | ||
|
||
fnm install v8.11.3 | ||
fnm use v8.11.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
8.11.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
DIRECTORY=`dirname $0` | ||
|
||
eval "`fnm env --multi`" | ||
fnm install 6.11.3 | ||
fnm install 8.11.3 | ||
fnm use 6.11.3 | ||
|
||
if hash zsh 2>/dev/null; then | ||
echo ' > Running test on Zsh' | ||
|
||
zsh -c ' | ||
set -e | ||
eval "`fnm env --multi --use-on-cd`" | ||
fnm use 6.11.3 | ||
NODE_VERSION=$(node -v) | ||
if [ "$NODE_VERSION" != "v6.11.3" ]; then | ||
echo "Failed: Node version ($NODE_VERSION) is not v6.11.3" | ||
exit 1 | ||
fi | ||
cd app | ||
NODE_VERSION=$(node -v) | ||
if [ "$NODE_VERSION" != "v8.11.3" ]; then | ||
echo "Failed: Node version ($NODE_VERSION) is not v8.11.3" | ||
exit 1 | ||
fi | ||
' | ||
else | ||
echo "Skipping zsh test: \`zsh\` is not installed" | ||
fi | ||
|
||
if hash fish 2>/dev/null; then | ||
echo ' > Running test on Fish' | ||
|
||
fish -c ' | ||
fnm env --multi --use-on-cd | source | ||
fnm use 6.11.3 | ||
set NODE_VERSION (node -v) | ||
if test "$NODE_VERSION" != "v6.11.3" | ||
echo "Failed: Node version ($NODE_VERSION) is not v6.11.3" | ||
exit 1 | ||
end | ||
cd app | ||
set NODE_VERSION (node -v) | ||
if test "$NODE_VERSION" != "v8.11.3" | ||
echo "Failed: Node version ($NODE_VERSION) is not v8.11.3" | ||
exit 1 | ||
end | ||
' | ||
else | ||
echo "Skipping fish test: \`zsh\` is not installed" | ||
fi | ||
|
||
echo " > Running test on Bash..." | ||
bash -c ' | ||
shopt -s expand_aliases | ||
eval "`fnm env --multi --use-on-cd`" | ||
fnm use 6.11.3 | ||
NODE_VERSION=$(node -v) | ||
if [ "$NODE_VERSION" != "v6.11.3" ]; then | ||
echo "Failed: Node version ($NODE_VERSION) is not v6.11.3" | ||
exit 1 | ||
fi | ||
cd app | ||
NODE_VERSION=$(node -v) | ||
if [ "$NODE_VERSION" != "v8.11.3" ]; then | ||
echo "Failed: Node version ($NODE_VERSION) is not v8.11.3" | ||
exit 1 | ||
fi | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters