@trendai-crem/claude-skills 0.6.1 → 0.6.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/cli.js +17 -12
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -196,21 +196,26 @@ LATEST=$(npm view "$PACKAGE" version 2>/dev/null || echo "")
|
|
|
196
196
|
# Validate LATEST is semver before executing
|
|
197
197
|
[[ "$LATEST" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]] || { echo "[$(date -Iseconds)] Invalid version from npm: $LATEST" >> "$LOG"; exit 1; }
|
|
198
198
|
|
|
199
|
-
# Update in background —
|
|
199
|
+
# Update in background — use nohup+disown so launchd doesn't kill child on job exit
|
|
200
200
|
echo "🔄 Updating claude-skills: $CURRENT_VER → $LATEST (background)"
|
|
201
|
-
(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
201
|
+
echo "[$(date -Iseconds)] Updating $CURRENT_VER → $LATEST" >> "$LOG"
|
|
202
|
+
STAMP_V="$STAMP" NOTIFY_V="$NOTIFY" LOG_V="$LOG" NOW_V="$NOW" \
|
|
203
|
+
PKG_V="\${PACKAGE}" LATEST_V="\${LATEST}" OLD_V="$CURRENT_VER" \
|
|
204
|
+
nohup bash -s << 'UPDATER' >> "$LOG" 2>&1 &
|
|
205
|
+
INSTALL_DIR="$(mktemp -d)"
|
|
206
|
+
if npm install --prefix "$INSTALL_DIR" "$PKG_V@$LATEST_V" --silent \
|
|
207
|
+
&& node "$INSTALL_DIR/node_modules/$PKG_V/cli.js"; then
|
|
208
|
+
rm -rf "$INSTALL_DIR"
|
|
209
|
+
python3 -c "import json,sys; json.dump({'ts': int(sys.argv[1]), 'version': sys.argv[2]}, open(sys.argv[3],'w'))" "$NOW_V" "$LATEST_V" "$STAMP_V"
|
|
210
|
+
echo "[$(date -Iseconds)] Update successful"
|
|
211
|
+
echo "✓ claude-skills updated: $OLD_V → $LATEST_V" > "$NOTIFY_V"
|
|
212
|
+
osascript -e "display notification \"Updated to $LATEST_V\" with title \"claude-skills\"" 2>/dev/null || true
|
|
210
213
|
else
|
|
211
|
-
|
|
214
|
+
rm -rf "$INSTALL_DIR"
|
|
215
|
+
echo "[$(date -Iseconds)] Update failed — will retry next session"
|
|
212
216
|
fi
|
|
213
|
-
|
|
217
|
+
UPDATER
|
|
218
|
+
disown
|
|
214
219
|
`;
|
|
215
220
|
}
|
|
216
221
|
|