Fix style, opening curly brace on the same line as function declaration.

master
Cliffano Subagio 2013-06-22 23:11:43 +10:00
parent ab71d50b3a
commit 39c5d0597d
1 changed files with 9 additions and 18 deletions

27
nvm.sh
View File

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