golem-cc 2.1.1 → 2.1.2
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/bin/golem +40 -6
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
11
|
-
VERSION="2.1.
|
|
11
|
+
VERSION="2.1.2"
|
|
12
12
|
GOLEM_HOME="${GOLEM_HOME:-$HOME/.golem}"
|
|
13
13
|
GOLEM_API="golem-api"
|
|
14
14
|
|
|
@@ -123,7 +123,8 @@ SYNC COMMANDS:
|
|
|
123
123
|
pr Create PR for current ticket
|
|
124
124
|
|
|
125
125
|
OTHER:
|
|
126
|
-
|
|
126
|
+
update [version] Update golem (default: latest)
|
|
127
|
+
install Install golem globally
|
|
127
128
|
uninstall Remove golem completely
|
|
128
129
|
config Show current configuration
|
|
129
130
|
doctor Diagnose setup issues
|
|
@@ -697,12 +698,42 @@ cmd_install() {
|
|
|
697
698
|
return
|
|
698
699
|
fi
|
|
699
700
|
|
|
701
|
+
# Default: install from npm
|
|
702
|
+
local version="${1:-latest}"
|
|
703
|
+
cmd_update "$version"
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
cmd_update() {
|
|
707
|
+
local version="${1:-latest}"
|
|
708
|
+
|
|
700
709
|
print_banner
|
|
701
|
-
info "
|
|
702
|
-
|
|
710
|
+
info "Fetching golem-cc@$version from npm..."
|
|
711
|
+
|
|
712
|
+
# Download to temp directory
|
|
713
|
+
local tmp
|
|
714
|
+
tmp=$(mktemp -d)
|
|
715
|
+
trap "rm -rf '$tmp'" EXIT
|
|
716
|
+
|
|
717
|
+
if ! pnpm --prefix="$tmp" add "golem-cc@$version" --silent 2>/dev/null; then
|
|
718
|
+
die "Failed to fetch golem-cc@$version"
|
|
719
|
+
fi
|
|
703
720
|
|
|
704
|
-
|
|
705
|
-
|
|
721
|
+
local pkg_path="$tmp/node_modules/golem-cc"
|
|
722
|
+
[[ ! -d "$pkg_path/bin" ]] && die "Downloaded package is invalid"
|
|
723
|
+
|
|
724
|
+
# Bootstrap from downloaded package
|
|
725
|
+
_resolve_pkg_root() { echo "$pkg_path"; }
|
|
726
|
+
cmd_bootstrap
|
|
727
|
+
|
|
728
|
+
# Update current project if we're in one
|
|
729
|
+
if [[ -d ".golem" ]]; then
|
|
730
|
+
echo ""
|
|
731
|
+
info "Updating project..."
|
|
732
|
+
cmd_init
|
|
733
|
+
fi
|
|
734
|
+
|
|
735
|
+
trap - EXIT
|
|
736
|
+
rm -rf "$tmp"
|
|
706
737
|
}
|
|
707
738
|
|
|
708
739
|
cmd_config() {
|
|
@@ -991,6 +1022,9 @@ main() {
|
|
|
991
1022
|
doctor)
|
|
992
1023
|
cmd_doctor "$@"
|
|
993
1024
|
;;
|
|
1025
|
+
update)
|
|
1026
|
+
cmd_update "$@"
|
|
1027
|
+
;;
|
|
994
1028
|
install)
|
|
995
1029
|
cmd_install "$@"
|
|
996
1030
|
;;
|