Update 2 files
- /.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_9-ensure-recent-nodejs-version - /.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_before_8-install-zx.tmpl
This commit is contained in:
parent
8f46c02426
commit
60f3e4cc1d
2 changed files with 19 additions and 13 deletions
|
@ -32,10 +32,10 @@ if ! command -v volta > /dev/null; then
|
||||||
fi
|
fi
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
logg 'Installing `node` via `volta`'
|
logg 'Installing `node` via `volta`'
|
||||||
volta install node
|
volta install node@latest
|
||||||
else
|
else
|
||||||
if ! node --version > /dev/null; then
|
if ! node --version > /dev/null; then
|
||||||
volta install node
|
volta install node@latest
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,15 +50,4 @@ if ! command -v zx > /dev/null; then
|
||||||
else
|
else
|
||||||
logg '`zx` is already installed'
|
logg '`zx` is already installed'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Ensure recent version of Node.js is being used
|
|
||||||
if command -v volta > /dev/null; then
|
|
||||||
if ! test "$(node --version | sed 's/^v//' | awk '{print $1}' | awk -F'.' ' ( $1 > 15) ')"; then
|
|
||||||
volta install node@latest
|
|
||||||
else
|
|
||||||
logg info 'Node.js appears to meet the minimum version requirements'
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
logg warn 'Volta is not installed'
|
|
||||||
fi
|
|
||||||
{{ end -}}
|
{{ end -}}
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
{{- if (ne .host.distro.family "windows") }}
|
||||||
|
|
||||||
|
# Node.js version: {{ output "node" "--version" }}
|
||||||
|
|
||||||
|
### Ensure recent version of Node.js is being used
|
||||||
|
if command -v volta > /dev/null; then
|
||||||
|
if ! test "$(node --version | sed 's/^v//' | awk '{print $1}' | awk -F'.' ' ( $1 > 15) ')"; then
|
||||||
|
logg info 'Installing latest version of Node.js'
|
||||||
|
volta install node@latest
|
||||||
|
else
|
||||||
|
logg info 'Node.js appears to meet the minimum version requirements (version >15)'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
logg warn 'Volta is not installed - skipping logic that ensures Node.js meets the version requirement of >15'
|
||||||
|
fi
|
||||||
|
{{ end -}}
|
Loading…
Reference in a new issue