golem-cc 0.1.20 → 0.1.22
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 +32 -1
- package/bin/install.cjs +6 -0
- package/package.json +1 -1
package/bin/golem
CHANGED
|
@@ -86,6 +86,35 @@ kv_line() {
|
|
|
86
86
|
printf " ${key_color}%-12s${NC} %s\n" "$key" "$value"
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
# Get version from package.json or embedded version file
|
|
90
|
+
get_version() {
|
|
91
|
+
# Check for version file first (created during global install)
|
|
92
|
+
if [[ -f "$GOLEM_DIR/VERSION" ]]; then
|
|
93
|
+
cat "$GOLEM_DIR/VERSION"
|
|
94
|
+
return
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# Check source directory package.json
|
|
98
|
+
local source_pkg="$(dirname "$SCRIPT_DIR")/package.json"
|
|
99
|
+
local pkg_file=""
|
|
100
|
+
|
|
101
|
+
if [[ -f "$source_pkg" ]]; then
|
|
102
|
+
pkg_file="$source_pkg"
|
|
103
|
+
elif [[ -f "$GOLEM_DIR/package.json" ]]; then
|
|
104
|
+
pkg_file="$GOLEM_DIR/package.json"
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
if [[ -n "$pkg_file" ]]; then
|
|
108
|
+
if command -v jq &>/dev/null; then
|
|
109
|
+
jq -r '.version // "unknown"' "$pkg_file" 2>/dev/null || echo "unknown"
|
|
110
|
+
else
|
|
111
|
+
grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' "$pkg_file" | head -1 | sed 's/.*"\([^"]*\)"$/\1/'
|
|
112
|
+
fi
|
|
113
|
+
else
|
|
114
|
+
echo "unknown"
|
|
115
|
+
fi
|
|
116
|
+
}
|
|
117
|
+
|
|
89
118
|
# Audit logging
|
|
90
119
|
log_event() {
|
|
91
120
|
local event="$1"
|
|
@@ -188,7 +217,9 @@ check_installed() {
|
|
|
188
217
|
# Install golem to current project
|
|
189
218
|
cmd_install() {
|
|
190
219
|
print_banner
|
|
191
|
-
|
|
220
|
+
local version
|
|
221
|
+
version=$(get_version)
|
|
222
|
+
header_box "INSTALLING v$version" "$BLUE"
|
|
192
223
|
echo ""
|
|
193
224
|
|
|
194
225
|
# Create directories
|
package/bin/install.cjs
CHANGED
|
@@ -267,6 +267,12 @@ function install(isGlobal) {
|
|
|
267
267
|
// Write VERSION file
|
|
268
268
|
const versionDest = path.join(claudeDir, 'golem', 'VERSION');
|
|
269
269
|
fs.writeFileSync(versionDest, pkg.version);
|
|
270
|
+
|
|
271
|
+
// For global install, also write VERSION to ~/.golem/ for CLI access
|
|
272
|
+
if (isGlobal) {
|
|
273
|
+
const golemVersionDest = path.join(golemHomeDir, 'VERSION');
|
|
274
|
+
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
275
|
+
}
|
|
270
276
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
271
277
|
|
|
272
278
|
// Install shell alias
|