mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-02-27 10:25:31 +08:00
Check yarn gets lazy loader if it's not installed via npm
This commit is contained in:
parent
e05c86722d
commit
650bcad0f7
26
tests/options/NVM_LAZY_LOAD adds lazy loader for external yarn
Executable file
26
tests/options/NVM_LAZY_LOAD adds lazy loader for external yarn
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
source ../common.sh
|
||||
|
||||
# Node.js version to install
|
||||
node_version=v5.11.0
|
||||
|
||||
# Load zsh-nvm and install Node.js in subshell
|
||||
(load_zsh_nvm && nvm install "$node_version" && [[ "$(node --version)" == "$node_version" ]]) || die "node wasn't installed"
|
||||
|
||||
# Check node isn't available
|
||||
[[ "$(node --version)" != "$node_version" ]] || die "node shouldn't be available $(node --version)"
|
||||
|
||||
# Set NVM_LAZY_LOAD to true
|
||||
export NVM_LAZY_LOAD=true
|
||||
|
||||
# Create placeholder yarn
|
||||
yarn() { echo yarn }
|
||||
|
||||
# Check yarn is a placeholder function
|
||||
[[ $(which yarn) != *"_zsh_nvm_load"* ]] || die "yarn should be a placeholder function"
|
||||
|
||||
# Load zsh-nvm
|
||||
load_zsh_nvm
|
||||
|
||||
# Check yarn is a lazy load function
|
||||
[[ $(which yarn) == *"_zsh_nvm_load"* ]] || die "yarn should be a lazy load function"
|
Loading…
Reference in New Issue
Block a user