skillpull 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skillpull +18 -16
package/package.json
CHANGED
package/skillpull
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
VERSION="0.3.
|
|
4
|
+
VERSION="0.3.3"
|
|
5
5
|
MANIFEST_FILE=".skillpull.json"
|
|
6
6
|
TMPDIR_PREFIX="skillpull"
|
|
7
7
|
CONFIG_DIR="$HOME/.config/skillpull"
|
|
@@ -670,19 +670,18 @@ cmd_push() {
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
cmd_uninstall() {
|
|
673
|
-
local
|
|
673
|
+
local self; self="$(realpath "$0" 2>/dev/null || echo "$0")"
|
|
674
|
+
local local_bin="${SKILLPULL_INSTALL_DIR:-$HOME/.local/bin}/skillpull"
|
|
674
675
|
|
|
675
676
|
printf "\n ${CYAN}Uninstall skillpull${RESET}\n\n"
|
|
676
677
|
|
|
677
|
-
# Remove binary
|
|
678
|
-
if [[ -f "$
|
|
679
|
-
rm -f "$
|
|
680
|
-
info "Removed $
|
|
681
|
-
else
|
|
682
|
-
dim "Binary not found at $global_bin"
|
|
678
|
+
# Remove local binary if exists
|
|
679
|
+
if [[ -f "$local_bin" ]]; then
|
|
680
|
+
rm -f "$local_bin"
|
|
681
|
+
info "Removed $local_bin"
|
|
683
682
|
fi
|
|
684
683
|
|
|
685
|
-
#
|
|
684
|
+
# Remove config
|
|
686
685
|
if [[ -d "$CONFIG_DIR" ]]; then
|
|
687
686
|
printf " Remove config (~/.config/skillpull)? (y/n) "
|
|
688
687
|
read -r yn
|
|
@@ -694,13 +693,16 @@ cmd_uninstall() {
|
|
|
694
693
|
fi
|
|
695
694
|
fi
|
|
696
695
|
|
|
697
|
-
# npm global
|
|
698
|
-
if command -v npm &>/dev/null
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
696
|
+
# npm global uninstall
|
|
697
|
+
if command -v npm &>/dev/null; then
|
|
698
|
+
local npm_global; npm_global="$(npm root -g 2>/dev/null)/../bin/skillpull"
|
|
699
|
+
if [[ -f "$npm_global" ]] || npm ls -g skillpull &>/dev/null 2>&1; then
|
|
700
|
+
printf " Remove npm global package? (y/n) "
|
|
701
|
+
read -r yn
|
|
702
|
+
if [[ "$yn" == "y" || "$yn" == "Y" ]]; then
|
|
703
|
+
npm uninstall -g skillpull 2>/dev/null
|
|
704
|
+
info "npm global package removed"
|
|
705
|
+
fi
|
|
704
706
|
fi
|
|
705
707
|
fi
|
|
706
708
|
|