@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.
Files changed (2) hide show
  1. package/cli.js +17 -12
  2. 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 — notification and stamp written only on success
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
- echo "[$(date -Iseconds)] Updating $CURRENT_VER $LATEST" >> "$LOG"
203
- if npx --yes --package "\${PACKAGE}@\${LATEST}" claude-skills >> "$LOG" 2>&1; then
204
- python3 -c "import json,sys; json.dump({'ts': int(sys.argv[1]), 'version': sys.argv[2]}, open(sys.argv[3],'w'))" "$NOW" "\${LATEST}" "$STAMP"
205
- echo "[$(date -Iseconds)] Update successful" >> "$LOG"
206
- # Write pending notification for next session start
207
- echo "✓ claude-skills updated: $CURRENT_VER → \${LATEST}" > "$NOTIFY"
208
- # macOS system notification (via launchd or background)
209
- osascript -e "display notification \"Updated to \${LATEST}\" with title \"claude-skills\"" 2>/dev/null || true
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
- echo "[$(date -Iseconds)] Update failed — will retry next session" >> "$LOG"
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendai-crem/claude-skills",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Claude Code skills installer for the trendai-crem team",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {