claude-code-backup 1.0.1 → 1.0.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/package.json +1 -1
- package/src/backends/github.js +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-backup",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Backup and auto-sync Claude Code memory, settings, and CLAUDE.md files to a private GitHub repo — with real-time file watching and macOS launchd auto-start",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/backends/github.js
CHANGED
|
@@ -477,6 +477,13 @@ export async function ensureRepo(config) {
|
|
|
477
477
|
writeFileSync(join(REPO_DIR, 'README.md'), buildReadme(config), 'utf8');
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
+
function localTimestamp() {
|
|
481
|
+
const d = new Date();
|
|
482
|
+
const pad = n => String(n).padStart(2, '0');
|
|
483
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ` +
|
|
484
|
+
`${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
485
|
+
}
|
|
486
|
+
|
|
480
487
|
export async function push(config, commitMessage) {
|
|
481
488
|
if (!existsSync(REPO_DIR)) {
|
|
482
489
|
log.error('Repo not set up. Run: claude-code-backup init');
|
|
@@ -524,7 +531,7 @@ export async function push(config, commitMessage) {
|
|
|
524
531
|
|
|
525
532
|
spin.text = `Committing ${status.files.length} change(s)...`;
|
|
526
533
|
await g.add('-A');
|
|
527
|
-
await g.commit(commitMessage || `backup: ${
|
|
534
|
+
await g.commit(commitMessage || `backup: ${localTimestamp()}`);
|
|
528
535
|
|
|
529
536
|
spin.text = 'Pushing to GitHub...';
|
|
530
537
|
await g.raw(['push', '-u', 'origin', config.github.branch]);
|