Skip to content

Commit

Permalink
stdlib: fix unused variable in use node
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed Jan 26, 2020
1 parent 89600c9 commit 7ae4fb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ const StdLib = "#!/usr/bin/env bash\n" +
"# Usage: use node\n" +
"# Loads NodeJS version from a `.node-version` or `.nvmrc` file.\n" +
"#\n" +
"# Usage: use node <version>\n" +
"# Usage: use node [<version>]\n" +
"# Loads specified NodeJS version.\n" +
"#\n" +
"# If you specify a partial NodeJS version (i.e. `4.2`), a fuzzy match\n" +
Expand All @@ -705,23 +705,23 @@ const StdLib = "#!/usr/bin/env bash\n" +
"# Overrides the default version prefix.\n" +
"\n" +
"use_node() {\n" +
" local version=$1\n" +
" local version=${1:-}\n" +
" local via=\"\"\n" +
" local node_version_prefix=${NODE_VERSION_PREFIX-node-v}\n" +
" local node_wanted\n" +
" local node_prefix\n" +
"\n" +
" if [[ -z $NODE_VERSIONS ]] || [[ ! -d $NODE_VERSIONS ]]; then\n" +
" if [[ -z ${NODE_VERSIONS:-} || ! -d $NODE_VERSIONS ]]; then\n" +
" log_error \"You must specify a \\$NODE_VERSIONS environment variable and the directory specified must exist!\"\n" +
" return 1\n" +
" fi\n" +
"\n" +
" if [[ -z $version ]] && [[ -f .nvmrc ]]; then\n" +
" if [[ -z $version && -f .nvmrc ]]; then\n" +
" version=$(<.nvmrc)\n" +
" via=\".nvmrc\"\n" +
" fi\n" +
"\n" +
" if [[ -z $version ]] && [[ -f .node-version ]]; then\n" +
" if [[ -z $version && -f .node-version ]]; then\n" +
" version=$(<.node-version)\n" +
" via=\".node-version\"\n" +
" fi\n" +
Expand Down
10 changes: 5 additions & 5 deletions stdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ rvm() {
# Usage: use node
# Loads NodeJS version from a `.node-version` or `.nvmrc` file.
#
# Usage: use node <version>
# Usage: use node [<version>]
# Loads specified NodeJS version.
#
# If you specify a partial NodeJS version (i.e. `4.2`), a fuzzy match
Expand All @@ -702,23 +702,23 @@ rvm() {
# Overrides the default version prefix.

use_node() {
local version=$1
local version=${1:-}
local via=""
local node_version_prefix=${NODE_VERSION_PREFIX-node-v}
local node_wanted
local node_prefix

if [[ -z $NODE_VERSIONS ]] || [[ ! -d $NODE_VERSIONS ]]; then
if [[ -z ${NODE_VERSIONS:-} || ! -d $NODE_VERSIONS ]]; then
log_error "You must specify a \$NODE_VERSIONS environment variable and the directory specified must exist!"
return 1
fi

if [[ -z $version ]] && [[ -f .nvmrc ]]; then
if [[ -z $version && -f .nvmrc ]]; then
version=$(<.nvmrc)
via=".nvmrc"
fi

if [[ -z $version ]] && [[ -f .node-version ]]; then
if [[ -z $version && -f .node-version ]]; then
version=$(<.node-version)
via=".node-version"
fi
Expand Down

0 comments on commit 7ae4fb2

Please sign in to comment.