Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–1876 unchanged (1876 lines)
1877 esac
1878
1879 # If running a 64bit ARM kernel but a 32bit ARM userland,
1880 # change ARCH to 32bit ARM (armv7l) if /sbin/init is 32bit executable
1881 local L
1882 if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] &&
1883 L="$(ls -dl /sbin/init 2>/dev/null)" &&
1884 [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
1885 NVM_ARCH=armv7l
1886 HOST_ARCH=armv7l
1887 fi
1888
1889 nvm_echo "${NVM_ARCH}"
…lines 1890–4365 unchanged (2476 lines)

After

…lines 1–1876 unchanged (1876 lines)
1877 esac
1878
1879 # If running a 64bit ARM kernel but a 32bit ARM userland,
1880 # change ARCH to 32bit ARM (armv7l) if /sbin/init is 32bit executable
1881 local L
1882 if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] &&
1883 L="$(command ls -dl /sbin/init 2>/dev/null)" &&
1884 [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
1885 NVM_ARCH=armv7l
1886 HOST_ARCH=armv7l
1887 fi
1888
1889 nvm_echo "${NVM_ARCH}"
…lines 1890–4365 unchanged (2476 lines)

Before

program
comment "# Node Version Manager"
comment "# Implemented as a POSIX-compliant function"
comment "# Should work on sh, dash, bash, ksh, zsh"
comment "# To use source this file from your bash profile"
comment "#"
comment "# Implemented by Tim Caswell <tim@creationix.com>"
comment "# with much bash help from Matthew Ranney"
comment "# \"local\" warning, quote expansion warning, sed warning, `lo"...
comment "# shellcheck disable=SC2039,SC2016,SC2001,SC3043"
compound_statement
{ "{"
comment "# this ensures the entire script is downloaded #"
comment "# shellcheck disable=SC3028"
variable_assignment
variable_name "NVM_SCRIPT_SOURCE"
= "="
string
" "\""
simple_expansion
$ "$"
special_variable_name "_"
" "\""
function_definition
word "nvm_is_zsh"
( "("
) ")"
compound_statement
{ "{"
test_command
[ "["
unary_expression
test_operator "-n"
string
" "\""
expansion
${ "${"
variable_name "ZSH_VERSION"
- "-"
} "}"
" "\""
] "]"
} "}"
function_definition
word "nvm_stdout_is_terminal"
( "("
) ")"
compound_statement
{ "{"
test_command
[ "["
unary_expression
test_operator "-t"
number "1"
] "]"
} "}"
function_definition (+23 nodes collapsed)
function_definition (+23 nodes collapsed)
function_definition
word "nvm_cd"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "\\cd"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition
word "nvm_err"
( "("
) ")"
compound_statement
{ "{"
command
file_redirect
>& ">&"
number "2"
command_name
word "nvm_echo"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition
word "nvm_err_with_colors"
( "("
) ")"
compound_statement
{ "{"
command
file_redirect
>& ">&"
number "2"
command_name
word "nvm_echo_with_colors"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition (+21 nodes collapsed)
function_definition (+26 nodes collapsed)
function_definition (+33 nodes collapsed)
function_definition (+27 nodes collapsed)
function_definition (+316 nodes collapsed)
function_definition (+57 nodes collapsed)
function_definition (+34 nodes collapsed)
function_definition (+25 nodes collapsed)
function_definition (+159 nodes collapsed)
function_definition (+112 nodes collapsed)
function_definition (+38 nodes collapsed)
function_definition (+38 nodes collapsed)
function_definition (+104 nodes collapsed)
function_definition (+40 nodes collapsed)
function_definition (+1269 nodes collapsed)
comment "# Make zsh glob matching behave same as bash"
comment "# This fixes the \"zsh: no matches found\" errors"
if_statement (+24 nodes collapsed)
if_statement
if "if"
command
command_name
word "nvm_is_zsh"
; ";"
then "then"
variable_assignment
variable_name "NVM_CD_FLAGS"
= "="
string
" "\""
string_content "-q"
" "\""
fi "fi"
comment "# Auto detect the NVM_DIR when not set"
if_statement (+144 nodes collapsed)
redirected_statement
unset_command
unset "unset"
variable_name "NVM_SCRIPT_SOURCE"
file_redirect
file_descriptor "2"
> ">"
word "/dev/null"
function_definition (+257 nodes collapsed)
function_definition (+94 nodes collapsed)
comment "# Traverse up in directory tree to find containing folder"
function_definition (+82 nodes collapsed)
function_definition (+52 nodes collapsed)
comment "# Obtain nvm version from rc file"
function_definition (+205 nodes collapsed)
function_definition (+24 nodes collapsed)
function_definition (+24 nodes collapsed)
function_definition (+30 nodes collapsed)
function_definition (+30 nodes collapsed)
function_definition (+140 nodes collapsed)
function_definition (+21 nodes collapsed)
function_definition (+140 nodes collapsed)
function_definition (+280 nodes collapsed)
comment "# Expand a version using the version cache"
function_definition (+214 nodes collapsed)
function_definition (+244 nodes collapsed)
function_definition (+511 nodes collapsed)
function_definition (+108 nodes collapsed)
function_definition (+21 nodes collapsed)
function_definition (+202 nodes collapsed)
function_definition (+76 nodes collapsed)
function_definition (+103 nodes collapsed)
function_definition (+125 nodes collapsed)
function_definition (+83 nodes collapsed)
function_definition (+317 nodes collapsed)
function_definition (+29 nodes collapsed)
function_definition (+348 nodes collapsed)
function_definition (+371 nodes collapsed)
function_definition (+160 nodes collapsed)
function_definition (+689 nodes collapsed)
function_definition (+199 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition (+124 nodes collapsed)
function_definition (+548 nodes collapsed)
function_definition (+144 nodes collapsed)
function_definition (+167 nodes collapsed)
function_definition (+414 nodes collapsed)
function_definition (+125 nodes collapsed)
function_definition
word "nvm_iojs_prefix"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
raw_string "'iojs'"
} "}"
function_definition
word "nvm_node_prefix"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
raw_string "'node'"
} "}"
function_definition (+31 nodes collapsed)
function_definition (+43 nodes collapsed)
function_definition (+71 nodes collapsed)
function_definition (+1210 nodes collapsed)
function_definition (+218 nodes collapsed)
function_definition (+31 nodes collapsed)
comment "# args flavor, type, version"
function_definition (+684 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition (+80 nodes collapsed)
function_definition (+337 nodes collapsed)
function_definition (+218 nodes collapsed)
comment "# args: flavor, type, version, slug, compression"
function_definition (+192 nodes collapsed)
function_definition (+655 nodes collapsed)
function_definition (+103 nodes collapsed)
function_definition (+704 nodes collapsed)
function_definition (+109 nodes collapsed)
function_definition
word "nvm_get_arch"
( "("
) ")"
compound_statement
{ "{"
declaration_command
local "local"
variable_name "HOST_ARCH"
declaration_command
local "local"
variable_name "NVM_OS"
declaration_command
local "local"
variable_name "EXIT_CODE"
variable_assignment
variable_name "NVM_OS"
= "="
string
" "\""
command_substitution
$( "$("
command
command_name
word "nvm_get_os"
) ")"
" "\""
comment "# If the OS is SunOS, first try to use pkgsrc to guess"
comment "# the most appropriate arch. If it's not available, use"
comment "# isainfo to get the instruction set supported by the"
comment "# kernel."
if_statement (+115 nodes collapsed)
declaration_command
local "local"
variable_name "NVM_ARCH"
case_statement (+60 nodes collapsed)
comment "# If running a 64bit ARM kernel but a 32bit ARM userland,"
comment "# change ARCH to 32bit ARM (armv7l) if /sbin/init is 32bit e"...
declaration_command
local "local"
variable_name "L"
if_statement
if "if"
list
list
list (+33 nodes collapsed)
&& "&&"
variable_assignment
variable_name "L"
= "="
string
" "\""
command_substitution
$( "$("
redirected_statement
command
command_name
word "ls"
word "-dl"
word "/sbin/init"
file_redirect
file_descriptor "2"
> ">"
word "/dev/null"
) ")"
" "\""
&& "&&"
test_command (+32 nodes collapsed)
; ";"
then "then"
variable_assignment
variable_name "NVM_ARCH"
= "="
word "armv7l"
variable_assignment
variable_name "HOST_ARCH"
= "="
word "armv7l"
fi "fi"
command
command_name
word "nvm_echo"
string
" "\""
expansion
${ "${"
variable_name "NVM_ARCH"
} "}"
" "\""
} "}"
function_definition (+180 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition
word "nvm_is_merged_node_version"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_version_greater_than_or_equal_to"
string
" "\""
simple_expansion
$ "$"
variable_name "1"
" "\""
word "v4.0.0"
} "}"
function_definition (+67 nodes collapsed)
comment "# args: os, prefixed version, version, tarball, extract dire"...
function_definition (+411 nodes collapsed)
comment "# args: flavor, type, version, reinstall"
function_definition (+533 nodes collapsed)
comment "# args: flavor, kind, version"
function_definition (+325 nodes collapsed)
function_definition (+94 nodes collapsed)
comment "# args: flavor, kind, type, version"
function_definition (+858 nodes collapsed)
comment "# args: nvm_os, version, tarball, tmpdir"
function_definition (+303 nodes collapsed)
function_definition (+304 nodes collapsed)
comment "# args: flavor, type, version, make jobs, additional"
function_definition (+827 nodes collapsed)
function_definition (+49 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+91 nodes collapsed)
function_definition (+152 nodes collapsed)
function_definition (+80 nodes collapsed)
function_definition (+906 nodes collapsed)
comment "# Succeeds if $IOJS_VERSION represents an io.js version that"...
comment "# Solaris binary, fails otherwise."
comment "# Currently, only io.js 3.3.1 has a Solaris binary available"...
comment "# latest io.js version available. The expectation is that an"...
comment "# version later than v3.3.1 will also have Solaris binaries."
function_definition (+82 nodes collapsed)
comment "# Succeeds if $NODE_VERSION represents a node version that h"...
comment "# Solaris binary, fails otherwise."
comment "# Currently, node versions starting from v0.8.6 have a Solar"...
comment "# available."
function_definition (+101 nodes collapsed)
comment "# Succeeds if $VERSION represents a version (node, io.js or "...
comment "# Solaris binary, fails otherwise."
function_definition (+76 nodes collapsed)
function_definition (+153 nodes collapsed)
function_definition (+81 nodes collapsed)
comment "# Check version dir permissions"
function_definition (+190 nodes collapsed)
function_definition
word "nvm_cache_dir"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
string
" "\""
expansion
${ "${"
variable_name "NVM_DIR"
} "}"
string_content "/.cache"
" "\""
} "}"
function_definition (+11049 nodes collapsed)
function_definition (+245 nodes collapsed)
function_definition (+66 nodes collapsed)
function_definition (+321 nodes collapsed)
function_definition (+312 nodes collapsed)
function_definition (+71 nodes collapsed)
command
command_name
word "nvm_process_parameters"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
comment "# this ensures the entire script is downloaded #"

After

program
comment "# Node Version Manager"
comment "# Implemented as a POSIX-compliant function"
comment "# Should work on sh, dash, bash, ksh, zsh"
comment "# To use source this file from your bash profile"
comment "#"
comment "# Implemented by Tim Caswell <tim@creationix.com>"
comment "# with much bash help from Matthew Ranney"
comment "# \"local\" warning, quote expansion warning, sed warning, `lo"...
comment "# shellcheck disable=SC2039,SC2016,SC2001,SC3043"
compound_statement
{ "{"
comment "# this ensures the entire script is downloaded #"
comment "# shellcheck disable=SC3028"
variable_assignment
variable_name "NVM_SCRIPT_SOURCE"
= "="
string
" "\""
simple_expansion
$ "$"
special_variable_name "_"
" "\""
function_definition
word "nvm_is_zsh"
( "("
) ")"
compound_statement
{ "{"
test_command
[ "["
unary_expression
test_operator "-n"
string
" "\""
expansion
${ "${"
variable_name "ZSH_VERSION"
- "-"
} "}"
" "\""
] "]"
} "}"
function_definition
word "nvm_stdout_is_terminal"
( "("
) ")"
compound_statement
{ "{"
test_command
[ "["
unary_expression
test_operator "-t"
number "1"
] "]"
} "}"
function_definition (+23 nodes collapsed)
function_definition (+23 nodes collapsed)
function_definition
word "nvm_cd"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "\\cd"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition
word "nvm_err"
( "("
) ")"
compound_statement
{ "{"
command
file_redirect
>& ">&"
number "2"
command_name
word "nvm_echo"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition
word "nvm_err_with_colors"
( "("
) ")"
compound_statement
{ "{"
command
file_redirect
>& ">&"
number "2"
command_name
word "nvm_echo_with_colors"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
function_definition (+21 nodes collapsed)
function_definition (+26 nodes collapsed)
function_definition (+33 nodes collapsed)
function_definition (+27 nodes collapsed)
function_definition (+316 nodes collapsed)
function_definition (+57 nodes collapsed)
function_definition (+34 nodes collapsed)
function_definition (+25 nodes collapsed)
function_definition (+159 nodes collapsed)
function_definition (+112 nodes collapsed)
function_definition (+38 nodes collapsed)
function_definition (+38 nodes collapsed)
function_definition (+104 nodes collapsed)
function_definition (+40 nodes collapsed)
function_definition (+1269 nodes collapsed)
comment "# Make zsh glob matching behave same as bash"
comment "# This fixes the \"zsh: no matches found\" errors"
if_statement (+24 nodes collapsed)
if_statement
if "if"
command
command_name
word "nvm_is_zsh"
; ";"
then "then"
variable_assignment
variable_name "NVM_CD_FLAGS"
= "="
string
" "\""
string_content "-q"
" "\""
fi "fi"
comment "# Auto detect the NVM_DIR when not set"
if_statement (+144 nodes collapsed)
redirected_statement
unset_command
unset "unset"
variable_name "NVM_SCRIPT_SOURCE"
file_redirect
file_descriptor "2"
> ">"
word "/dev/null"
function_definition (+257 nodes collapsed)
function_definition (+94 nodes collapsed)
comment "# Traverse up in directory tree to find containing folder"
function_definition (+82 nodes collapsed)
function_definition (+52 nodes collapsed)
comment "# Obtain nvm version from rc file"
function_definition (+205 nodes collapsed)
function_definition (+24 nodes collapsed)
function_definition (+24 nodes collapsed)
function_definition (+30 nodes collapsed)
function_definition (+30 nodes collapsed)
function_definition (+140 nodes collapsed)
function_definition (+21 nodes collapsed)
function_definition (+140 nodes collapsed)
function_definition (+280 nodes collapsed)
comment "# Expand a version using the version cache"
function_definition (+214 nodes collapsed)
function_definition (+244 nodes collapsed)
function_definition (+511 nodes collapsed)
function_definition (+108 nodes collapsed)
function_definition (+21 nodes collapsed)
function_definition (+202 nodes collapsed)
function_definition (+76 nodes collapsed)
function_definition (+103 nodes collapsed)
function_definition (+125 nodes collapsed)
function_definition (+83 nodes collapsed)
function_definition (+317 nodes collapsed)
function_definition (+29 nodes collapsed)
function_definition (+348 nodes collapsed)
function_definition (+371 nodes collapsed)
function_definition (+160 nodes collapsed)
function_definition (+689 nodes collapsed)
function_definition (+199 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition (+124 nodes collapsed)
function_definition (+548 nodes collapsed)
function_definition (+144 nodes collapsed)
function_definition (+167 nodes collapsed)
function_definition (+414 nodes collapsed)
function_definition (+125 nodes collapsed)
function_definition
word "nvm_iojs_prefix"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
raw_string "'iojs'"
} "}"
function_definition
word "nvm_node_prefix"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
raw_string "'node'"
} "}"
function_definition (+31 nodes collapsed)
function_definition (+43 nodes collapsed)
function_definition (+71 nodes collapsed)
function_definition (+1210 nodes collapsed)
function_definition (+218 nodes collapsed)
function_definition (+31 nodes collapsed)
comment "# args flavor, type, version"
function_definition (+684 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition (+80 nodes collapsed)
function_definition (+337 nodes collapsed)
function_definition (+218 nodes collapsed)
comment "# args: flavor, type, version, slug, compression"
function_definition (+192 nodes collapsed)
function_definition (+655 nodes collapsed)
function_definition (+103 nodes collapsed)
function_definition (+704 nodes collapsed)
function_definition (+109 nodes collapsed)
function_definition
word "nvm_get_arch"
( "("
) ")"
compound_statement
{ "{"
declaration_command
local "local"
variable_name "HOST_ARCH"
declaration_command
local "local"
variable_name "NVM_OS"
declaration_command
local "local"
variable_name "EXIT_CODE"
variable_assignment
variable_name "NVM_OS"
= "="
string
" "\""
command_substitution
$( "$("
command
command_name
word "nvm_get_os"
) ")"
" "\""
comment "# If the OS is SunOS, first try to use pkgsrc to guess"
comment "# the most appropriate arch. If it's not available, use"
comment "# isainfo to get the instruction set supported by the"
comment "# kernel."
if_statement (+115 nodes collapsed)
declaration_command
local "local"
variable_name "NVM_ARCH"
case_statement (+60 nodes collapsed)
comment "# If running a 64bit ARM kernel but a 32bit ARM userland,"
comment "# change ARCH to 32bit ARM (armv7l) if /sbin/init is 32bit e"...
declaration_command
local "local"
variable_name "L"
if_statement
if "if"
list
list
list (+33 nodes collapsed)
&& "&&"
variable_assignment
variable_name "L"
= "="
string
" "\""
command_substitution
$( "$("
redirected_statement
command
command_name
word "command"
word "ls"
word "-dl"
word "/sbin/init"
file_redirect
file_descriptor "2"
> ">"
word "/dev/null"
) ")"
" "\""
&& "&&"
test_command (+32 nodes collapsed)
; ";"
then "then"
variable_assignment
variable_name "NVM_ARCH"
= "="
word "armv7l"
variable_assignment
variable_name "HOST_ARCH"
= "="
word "armv7l"
fi "fi"
command
command_name
word "nvm_echo"
string
" "\""
expansion
${ "${"
variable_name "NVM_ARCH"
} "}"
" "\""
} "}"
function_definition (+180 nodes collapsed)
function_definition (+118 nodes collapsed)
function_definition
word "nvm_is_merged_node_version"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_version_greater_than_or_equal_to"
string
" "\""
simple_expansion
$ "$"
variable_name "1"
" "\""
word "v4.0.0"
} "}"
function_definition (+67 nodes collapsed)
comment "# args: os, prefixed version, version, tarball, extract dire"...
function_definition (+411 nodes collapsed)
comment "# args: flavor, type, version, reinstall"
function_definition (+533 nodes collapsed)
comment "# args: flavor, kind, version"
function_definition (+325 nodes collapsed)
function_definition (+94 nodes collapsed)
comment "# args: flavor, kind, type, version"
function_definition (+858 nodes collapsed)
comment "# args: nvm_os, version, tarball, tmpdir"
function_definition (+303 nodes collapsed)
function_definition (+304 nodes collapsed)
comment "# args: flavor, type, version, make jobs, additional"
function_definition (+827 nodes collapsed)
function_definition (+49 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+91 nodes collapsed)
function_definition (+152 nodes collapsed)
function_definition (+80 nodes collapsed)
function_definition (+906 nodes collapsed)
comment "# Succeeds if $IOJS_VERSION represents an io.js version that"...
comment "# Solaris binary, fails otherwise."
comment "# Currently, only io.js 3.3.1 has a Solaris binary available"...
comment "# latest io.js version available. The expectation is that an"...
comment "# version later than v3.3.1 will also have Solaris binaries."
function_definition (+82 nodes collapsed)
comment "# Succeeds if $NODE_VERSION represents a node version that h"...
comment "# Solaris binary, fails otherwise."
comment "# Currently, node versions starting from v0.8.6 have a Solar"...
comment "# available."
function_definition (+101 nodes collapsed)
comment "# Succeeds if $VERSION represents a version (node, io.js or "...
comment "# Solaris binary, fails otherwise."
function_definition (+76 nodes collapsed)
function_definition (+153 nodes collapsed)
function_definition (+81 nodes collapsed)
comment "# Check version dir permissions"
function_definition (+190 nodes collapsed)
function_definition
word "nvm_cache_dir"
( "("
) ")"
compound_statement
{ "{"
command
command_name
word "nvm_echo"
string
" "\""
expansion
${ "${"
variable_name "NVM_DIR"
} "}"
string_content "/.cache"
" "\""
} "}"
function_definition (+11049 nodes collapsed)
function_definition (+245 nodes collapsed)
function_definition (+66 nodes collapsed)
function_definition (+321 nodes collapsed)
function_definition (+312 nodes collapsed)
function_definition (+71 nodes collapsed)
command
command_name
word "nvm_process_parameters"
string
" "\""
simple_expansion
$ "$"
special_variable_name "@"
" "\""
} "}"
comment "# this ensures the entire script is downloaded #"