Skip to content

Commit

Permalink
shellcheck: feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Apr 4, 2019
1 parent c28a062 commit 9f3239a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis/shellchecker
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

# Wrapper for running `shellcheck` over projects.

shopt -s extglob
cd "$(dirname "$0")/../" || exit 1
set -e
cd "$(dirname "$0")/../"

# find shell files under the specified directory
find_files () {
Expand Down
6 changes: 3 additions & 3 deletions bin/cylc
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ __HELP__
fi
fi
# If category name is used as arg, call the help func with the category
local COMMAND
if [[ $# -gt 1 && ( "${CATEGORIES[*]} " == *" $1 "*
|| " ${HELP_OPTS[*]} " == *" $1 "* ) ]]; then
local COMMAND="${CYLC_HOME_BIN}/cylc-help"
COMMAND="${CYLC_HOME_BIN}/cylc-help"
exec "${COMMAND}" "$@"
fi
# Deal with cases like 'cylc --help [COMMAND/CATEGORY]'
if [[ $# -gt 1 && -f "$(ls "cylc-$2"* 2>'/dev/null')" ]]; then
COMMAND="${CYLC_HOME_BIN}/$(ls "cylc-$2"*)"
local COMMAND
exec "${COMMAND}" "--help"
fi
# If not a category or not an actual command in the bin dir, exit
Expand Down Expand Up @@ -152,8 +152,8 @@ path_lead() {
}

get_command_from_abbr() {
COMMAND="$(cd "${CYLC_HOME_BIN}" && ls "cylc-$1"* 2>'/dev/null')"
local COMMAND
COMMAND="$(cd "${CYLC_HOME_BIN}" && ls "cylc-$1"* 2>'/dev/null')"
if [[ -z "${COMMAND}" ]]; then
# Abbreviation has no match, bad
echo "cylc $1: unknown utility. Abort." >&2
Expand Down
4 changes: 3 additions & 1 deletion bin/cylc-make-docs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set -eu

usage() {
echo "Usage: cylc [admin] make-docs [--help]"
echo "Build the HTML User Guide, with Sphinx."
Expand All @@ -36,7 +38,7 @@ fi
echo >&2
echo "Building the HTML Cylc Documentation with Sphinx:"
echo >&2
cd "$CYLC_DIR/doc/" || exit 1
cd "$CYLC_DIR/doc/"
echo "... Generating the command reference ..."
./src/custom/make-commands.sh
echo >&2
Expand Down

0 comments on commit 9f3239a

Please sign in to comment.