Skip to content

Commit

Permalink
Move --trace and --version into their own plugins (closes #30)
Browse files Browse the repository at this point in the history
As detailed in #30, `version` returns to being a core plugin,
while the `trace` plugin is moving out.
  • Loading branch information
stuartpb committed Aug 17, 2014
1 parent d14ce1d commit 1b9d68b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
16 changes: 0 additions & 16 deletions bin/plushu
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,6 @@ done

# Process options
while [[ "x$1" == x-* ]]; do case "$1" in
--trace|-t)
export PLUSHU_TRACE=1
set -x
shift
;;

--version|-v)
if [[ -d "$PLUSHU_ROOT/.git" ]]; then
GIT_DIR="$PLUSHU_ROOT/.git" git describe
exit 0
else
echo "No .git directory in $PLUSHU_ROOT, version unknown" >&2
exit 1
fi
;;

--)
# explicitly stop processing arguments
# for when the command name (for some inexplicable reason)
Expand Down
18 changes: 13 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ if command -v git >/dev/null 2>&1; then
git clone https://github.com/plushu/plushu-help-plugin \
"$PLUSHU_ROOT/plugins/help"
fi
if [ ! -d "$PLUSHU_ROOT/plugins/version" ]; then
git clone https://github.com/plushu/plushu-version \
"$PLUSHU_ROOT/plugins/version"
fi
elif command -v git >/dev/null 2>&1; then
echo 'Git does not appear to be present on your system; falling back to'
echo 'curl to install the core `plugins` and `help` plugins.'
echo 'curl to install the core `plugins`, `help`, and `version` plugins.'
echo 'It is recommended that you install Git for managing plugins;'
echo 'if you do, delete plugins/plugins and plugins/help, then rerun'
echo 'this installer to re-install these plugins via Git.'
Expand All @@ -47,11 +51,15 @@ elif command -v git >/dev/null 2>&1; then
curl `gh_archive plushu-help-plugin` |
tar xzC "$PLUSHU_ROOT/plugins/help"
fi
if [ ! -d "$PLUSHU_ROOT/plugins/version" ]; then
curl `gh_archive plushu-version` |
tar xzC "$PLUSHU_ROOT/plugins/version"
fi
else
echo 'The core `plugins` and `help` plugins were not installed because'
echo 'Git does not appear to be present on your system (and no `curl`'
echo 'fallback was present either).'
echo 'To install the core plugins, install Git, then re-run this installer.'
echo 'The core `plugins`, `help`, and `version` plugins were not installed'
echo 'because neither Git nor curl appears to be present on your system.'
echo 'To install the core plugins, install Git (or curl), then re-run this'
echo 'installer.'
fi

# If root is performing the installation
Expand Down

0 comments on commit 1b9d68b

Please sign in to comment.