@aiassesstech/mighty-mark 0.6.15 → 0.6.18
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiassesstech/mighty-mark",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.18",
|
|
4
4
|
"description": "System Health Sentinel for AI Assess Tech Fleet — autonomous monitoring, watchdog recovery, and fleet infrastructure oversight.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,10 +89,6 @@ PUSH_WORK=""
|
|
|
89
89
|
|
|
90
90
|
cleanup() {
|
|
91
91
|
[[ -n "$STAGING_DIR" ]] && rm -rf "$STAGING_DIR"
|
|
92
|
-
[[ -n "$PUSH_WORK" ]] && rm -rf "$PUSH_WORK"
|
|
93
|
-
if [[ -n "${GITHUB_REPO_DIR:-}" ]]; then
|
|
94
|
-
git -C "$GITHUB_REPO_DIR" worktree prune 2>/dev/null || true
|
|
95
|
-
fi
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
on_error() {
|
|
@@ -298,7 +294,6 @@ log "Manifest: $MANIFEST_FILE"
|
|
|
298
294
|
if [[ "${PUSH_TO_GITHUB:-false}" == "true" ]] && [[ -d "${GITHUB_REPO_DIR:-}" ]]; then
|
|
299
295
|
log "Pushing backup to GitHub (branch: $GITHUB_BACKUP_BRANCH)..."
|
|
300
296
|
|
|
301
|
-
PUSH_WORK=$(mktemp -d "/tmp/fleet-backup-push-XXXXXX")
|
|
302
297
|
GITHUB_RETENTION=${GITHUB_RETENTION:-14}
|
|
303
298
|
|
|
304
299
|
(
|
|
@@ -310,17 +305,17 @@ if [[ "${PUSH_TO_GITHUB:-false}" == "true" ]] && [[ -d "${GITHUB_REPO_DIR:-}" ]]
|
|
|
310
305
|
exit 1
|
|
311
306
|
fi
|
|
312
307
|
|
|
313
|
-
git
|
|
308
|
+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
309
|
+
if [[ "$CURRENT_BRANCH" != "$GITHUB_BACKUP_BRANCH" ]]; then
|
|
310
|
+
git checkout "$GITHUB_BACKUP_BRANCH" 2>/dev/null || git checkout -b "$GITHUB_BACKUP_BRANCH" 2>/dev/null || true
|
|
311
|
+
fi
|
|
312
|
+
|
|
313
|
+
git pull origin "$GITHUB_BACKUP_BRANCH" --ff-only 2>/dev/null || true
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
else
|
|
320
|
-
cd "$PUSH_WORK"
|
|
321
|
-
git init
|
|
322
|
-
git remote add origin "$REMOTE_URL"
|
|
323
|
-
git checkout --orphan "$GITHUB_BACKUP_BRANCH"
|
|
315
|
+
# Ensure .tar.gz files are not gitignored (archives must be committed)
|
|
316
|
+
if grep -q '^\*\.tar\.gz$' .gitignore 2>/dev/null; then
|
|
317
|
+
sed -i '/^\*\.tar\.gz$/d' .gitignore
|
|
318
|
+
log " Removed *.tar.gz from .gitignore"
|
|
324
319
|
fi
|
|
325
320
|
|
|
326
321
|
# Split large archives into chunks under GitHub's file size limit
|
|
@@ -344,7 +339,6 @@ if [[ "${PUSH_TO_GITHUB:-false}" == "true" ]] && [[ -d "${GITHUB_REPO_DIR:-}" ]]
|
|
|
344
339
|
log " Pruning $PRUNE_COUNT old backup(s) from GitHub (keeping last $GITHUB_RETENTION)..."
|
|
345
340
|
ls -1t fleet-*.tar.gz | tail -n "$PRUNE_COUNT" | while read -r OLD; do
|
|
346
341
|
rm -f "$OLD"
|
|
347
|
-
# Also remove any split chunks for this archive
|
|
348
342
|
rm -f "${OLD}".part-* 2>/dev/null
|
|
349
343
|
log " Removed: $OLD"
|
|
350
344
|
done
|