Give a more clear name to the "contrib" directory that contains
architecture and configuration independent data. New directory name is
"share", which correctly matches the destination of these files into the
installation directory.
- LastExitCode is now always set to 0 or 1, depending on the success of
the command.
- If there is an error we throw an exception in envmodule and ml.
- If the subcommand is a query, e.g. `is-avail`, we return a boolean
value.
The pwsh initialization works similar to the cmd initialization.
Autoinit will not work on Windows due to the hard-coded paths in
modulecmd.tcl. On other platforms the autoinit should work for pwsh.
This reverts commit 59ac24e243.
FPATH variable cannot be handled within autoinit process as this is not
an environment variable. Thus when modulecmd.tcl is executed, it does
not know the current value of FPATH. So if it sets FPATH during
autoinit, previous value of this variable is lost. As a result FPATH
must stay defined in initialization script.
According to ShellCheck's documentation:
When command expansions are unquoted, word splitting and globbing will occur.
This often manifests itself by breaking when filenames contain spaces.
Related: https://www.shellcheck.net/wiki/SC2046
Related: #470
Some variables, that were unquoted intentionally were converted to arrays.
According to ShellCheck's documentation:
Quoting variables prevents word splitting and glob expansion, and prevents
the script from breaking when input contains spaces, line feeds, glob
characters and such.
Related: https://www.shellcheck.net/wiki/SC2086
Related: #470
These occurrences do not seem to cause any problems described below but
let's still fix it for the sake of consistency within this script.
According to ShellCheck's documentation:
ShellCheck noticed that you have used a variable as an array, but then assign
it a string. array=foo is equivalent to array[0]=foo, and leaves the rest
of the elements unaffected.
Related: https://www.shellcheck.net/wiki/SC2178
Related: #470
According to ShellCheck's documentation:
-a and -o in [ .. ] test expressions are not well defined, and can cause
incorrect results when arguments start with dashes or contain !.
Related: https://www.shellcheck.net/wiki/SC2166
Related: #470
According to ShellCheck's documentation:
Bourne shells are very whitespace sensitive. Adding or removing spaces can
drastically alter the meaning of a script.
Related: https://www.shellcheck.net/wiki/SC1035
Related: #470