Browse Source

small fix

main
pvincent 3 days ago
parent
commit
a64c63680a
  1. 2
      README.md
  2. 4
      bin/miaou-bash
  3. 4
      lib/uninstall.bash

2
README.md

@ -43,7 +43,7 @@ miaou-bash --self-upgrade
## uninstall ## uninstall
```bash ```bash
TODO: miaou-bash --uninstall
miaou-bash --uninstall
``` ```

4
bin/miaou-bash

@ -613,13 +613,15 @@ function usage {
function parse_options { function parse_options {
[[ $# == 0 ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 [[ $# == 0 ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2
[[ $# == 1 ]] && case "$1" in
if [[ $# == 1 ]]; then
case "$1" in
--help) usage && builtin exit ;; --help) usage && builtin exit ;;
--version) cat "${MIAOU_BASH_DIR:-/opt/miaou-bash}/.semver_git_tag" && builtin exit ;; --version) cat "${MIAOU_BASH_DIR:-/opt/miaou-bash}/.semver_git_tag" && builtin exit ;;
--self-upgrade) self_upgrade && builtin exit ;; --self-upgrade) self_upgrade && builtin exit ;;
--uninstall) uninstall && builtin exit ;; --uninstall) uninstall && builtin exit ;;
-*) >&2 echo "ERROR: option '$1' unknown!" && usage && builtin exit 2 ;; -*) >&2 echo "ERROR: option '$1' unknown!" && usage && builtin exit 2 ;;
esac esac
fi
[[ $1 =~ ^- ]] && >&2 echo "ERROR: too many args $#, either single option or SCRIPT + args accepted!" && builtin exit 2 [[ $1 =~ ^- ]] && >&2 echo "ERROR: too many args $#, either single option or SCRIPT + args accepted!" && builtin exit 2
SCRIPT="$1" SCRIPT="$1"
[[ ! -v SCRIPT ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2 [[ ! -v SCRIPT ]] && >&2 echo 'ERROR: script expected!' && builtin exit 2

4
lib/uninstall.bash

@ -5,6 +5,10 @@
cd || exit cd || exit
source "$MIAOU_BASH_DIR"/lib/functions.bash
_confirm_destructive
if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then
rm /etc/bash.bashrc rm /etc/bash.bashrc
mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc

Loading…
Cancel
Save