Skip to content

Commit

Permalink
Propagate user arguments to libexec scripts
Browse files Browse the repository at this point in the history
`bin/git-elegant` is the main entry script which has to pass all
arguments to `libexec/git-elegant` script, otherwise, a help message
will be printed and there is no chance to call any other command -
in other words, there is a bug. Since this change, all arguments will be
propagated to right place and "Elegant git" should work as expected.

Testing approach is based on invocation an unknown command after the
installation. This initiates the real call to "Elegant git" logic. So,
the arguments propagation logic is tested. Previous solution (invoke
`help` command) is not a good choice as help message can be shown in
many cases (untrustworthy results of testing).
  • Loading branch information
extsoft committed Jul 16, 2019
1 parent 574e103 commit c26e051
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/git-elegant
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ while [[ -h "$SOURCE" ]]; do
done
INSTALLATION="$(cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd)"

exec "${INSTALLATION}/../libexec/git-elegant"
exec "${INSTALLATION}/../libexec/git-elegant" $@
7 changes: 6 additions & 1 deletion quality-pipeline.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ fail() {

pipeline() {
bats --tap tests || fail "Unit tests are failed."
./install.bash /usr/local src && git elegant help || fail "Installation test is failed."
(
echo "Installation...."
./install.bash /usr/local src
echo "'Unknown command' testing..."
git elegant unknown-command | grep "Unknown command: git elegant unknown-command"
) || fail "Installation test is failed."
mkdocs build --clean --strict || fail "Unable to build the documentation."
pdd --exclude=.idea/**/* \
--exclude=site/**/* \
Expand Down

0 comments on commit c26e051

Please sign in to comment.