Commit Graph

4 Commits

Author SHA1 Message Date
Lukáš Zaoral
5939a00154 lint(ShellCheck): fix SC2155 warning
According to ShellCheck's documentation:

In the original code, the return value of mycmd in $(mycmd) is ignored,
and export will instead always return true.  This may prevent conditionals,
set -e and traps from working correctly.

Related: https://www.shellcheck.net/wiki/SC2155
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
7418b3fce0 lint(ShellCheck): fix SC2128 warning
These occurrences do not cause any problems described below but it's better
to be verbose that we indeed want to access the first array element.

According to ShellCheck's documentation:

When referencing arrays, $myarray is equivalent to ${myarray[0]} --
it results in only the first of multiple elements.

Related: https://www.shellcheck.net/wiki/SC2128
Related: #470
2022-09-02 09:52:05 +02:00
Xavier Delaruelle
919662c3c2 doc: desc setup with shell-specific scripts in cookbook
Update the *Source script in modulefile* cookbook recipe to add it a
*Usage with shell-specific scripts* section that demonstrate how to use
modulefiles with `source-sh` commands when software provide a specific
initialization script for each shell it supports.

Take this opportunity to improve the readability of this recipe by
coloring/highlighting shell session examples.

Fixes #399.
2021-05-30 15:16:33 +02:00
Xavier Delaruelle
d15b7c6494 doc: add source-script-in-modulefile recipe 2020-06-01 21:03:12 +02:00