Fix style, opening curly brace on the same line as function declaration.
parent
ab71d50b3a
commit
39c5d0597d
27
nvm.sh
27
nvm.sh
|
@ -18,8 +18,7 @@ if [ ! -z "$(which unsetopt 2>/dev/null)" ]; then
|
||||||
unsetopt nomatch 2>/dev/null
|
unsetopt nomatch 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nvm_set_nullglob()
|
nvm_set_nullglob() {
|
||||||
{
|
|
||||||
if type setopt > /dev/null 2>&1; then
|
if type setopt > /dev/null 2>&1; then
|
||||||
# Zsh
|
# Zsh
|
||||||
setopt NULL_GLOB
|
setopt NULL_GLOB
|
||||||
|
@ -30,8 +29,7 @@ nvm_set_nullglob()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Obtain nvm version from rc file
|
# Obtain nvm version from rc file
|
||||||
rc_nvm_version()
|
rc_nvm_version() {
|
||||||
{
|
|
||||||
if [ -e .nvmrc ]; then
|
if [ -e .nvmrc ]; then
|
||||||
RC_VERSION=`cat .nvmrc | head -n 1`
|
RC_VERSION=`cat .nvmrc | head -n 1`
|
||||||
echo "Found .nvmrc files with version <$RC_VERSION>"
|
echo "Found .nvmrc files with version <$RC_VERSION>"
|
||||||
|
@ -39,8 +37,7 @@ rc_nvm_version()
|
||||||
}
|
}
|
||||||
|
|
||||||
# Expand a version using the version cache
|
# Expand a version using the version cache
|
||||||
nvm_version()
|
nvm_version() {
|
||||||
{
|
|
||||||
local PATTERN=$1
|
local PATTERN=$1
|
||||||
# The default version is the current one
|
# The default version is the current one
|
||||||
if [ ! "$PATTERN" ]; then
|
if [ ! "$PATTERN" ]; then
|
||||||
|
@ -55,8 +52,7 @@ nvm_version()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_remote_version()
|
nvm_remote_version() {
|
||||||
{
|
|
||||||
local PATTERN=$1
|
local PATTERN=$1
|
||||||
VERSION=`nvm_ls_remote $PATTERN | tail -n1`
|
VERSION=`nvm_ls_remote $PATTERN | tail -n1`
|
||||||
echo "$VERSION"
|
echo "$VERSION"
|
||||||
|
@ -66,8 +62,7 @@ nvm_remote_version()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_ls()
|
nvm_ls() {
|
||||||
{
|
|
||||||
local PATTERN=$1
|
local PATTERN=$1
|
||||||
local VERSIONS=''
|
local VERSIONS=''
|
||||||
if [ "$PATTERN" = 'current' ]; then
|
if [ "$PATTERN" = 'current' ]; then
|
||||||
|
@ -94,8 +89,7 @@ nvm_ls()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_ls_remote()
|
nvm_ls_remote() {
|
||||||
{
|
|
||||||
local PATTERN=$1
|
local PATTERN=$1
|
||||||
local VERSIONS
|
local VERSIONS
|
||||||
if [ "$PATTERN" ]; then
|
if [ "$PATTERN" ]; then
|
||||||
|
@ -117,8 +111,7 @@ nvm_ls_remote()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_checksum()
|
nvm_checksum() {
|
||||||
{
|
|
||||||
if [ "$1" = "$2" ]; then
|
if [ "$1" = "$2" ]; then
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
@ -128,8 +121,7 @@ nvm_checksum()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print_versions()
|
print_versions() {
|
||||||
{
|
|
||||||
local OUTPUT=''
|
local OUTPUT=''
|
||||||
local PADDED_VERSION=''
|
local PADDED_VERSION=''
|
||||||
for VERSION in $1; do
|
for VERSION in $1; do
|
||||||
|
@ -142,8 +134,7 @@ print_versions()
|
||||||
echo -e "$OUTPUT"
|
echo -e "$OUTPUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm()
|
nvm() {
|
||||||
{
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
nvm help
|
nvm help
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue