jettypod 4.2.3 → 4.2.5
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/jettypod.js +55 -0
- package/package.json +1 -1
package/jettypod.js
CHANGED
|
@@ -16,6 +16,55 @@ try {
|
|
|
16
16
|
GIT_ROOT = process.cwd();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Ensure jettypod-specific paths are gitignored and untracked
|
|
21
|
+
* Called during init and update to fix existing projects
|
|
22
|
+
*/
|
|
23
|
+
function ensureJettypodGitignores() {
|
|
24
|
+
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
25
|
+
const entriesToIgnore = [
|
|
26
|
+
'.claude/session.md',
|
|
27
|
+
'.jettypod-work/'
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
// Add entries to .gitignore if not present
|
|
31
|
+
let gitignoreContent = '';
|
|
32
|
+
if (fs.existsSync(gitignorePath)) {
|
|
33
|
+
gitignoreContent = fs.readFileSync(gitignorePath, 'utf-8');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let modified = false;
|
|
37
|
+
for (const entry of entriesToIgnore) {
|
|
38
|
+
if (!gitignoreContent.includes(entry)) {
|
|
39
|
+
const newEntry = gitignoreContent.endsWith('\n') || gitignoreContent === ''
|
|
40
|
+
? `${entry}\n`
|
|
41
|
+
: `\n${entry}\n`;
|
|
42
|
+
gitignoreContent += newEntry;
|
|
43
|
+
modified = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (modified) {
|
|
48
|
+
fs.writeFileSync(gitignorePath, gitignoreContent);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Untrack session.md if it's currently tracked
|
|
52
|
+
try {
|
|
53
|
+
const { execSync } = require('child_process');
|
|
54
|
+
// Check if file is tracked
|
|
55
|
+
execSync(`git ls-files --error-unmatch .claude/session.md 2>/dev/null`, {
|
|
56
|
+
encoding: 'utf-8',
|
|
57
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// If we get here, file is tracked - untrack it
|
|
61
|
+
execSync('git rm --cached .claude/session.md', { stdio: 'pipe' });
|
|
62
|
+
console.log('📝 Untracked .claude/session.md (now gitignored)');
|
|
63
|
+
} catch (e) {
|
|
64
|
+
// File not tracked or git error - that's fine
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
19
68
|
// CLAUDE.md generation
|
|
20
69
|
const claude = {
|
|
21
70
|
async generate(config, options = {}) {
|
|
@@ -617,6 +666,9 @@ async function initializeProject() {
|
|
|
617
666
|
fs.mkdirSync('.claude', { recursive: true });
|
|
618
667
|
}
|
|
619
668
|
|
|
669
|
+
// Ensure .claude/session.md is gitignored and untracked
|
|
670
|
+
ensureJettypodGitignores();
|
|
671
|
+
|
|
620
672
|
const claudeSettingsPath = path.join('.claude', 'settings.json');
|
|
621
673
|
if (!fs.existsSync(claudeSettingsPath)) {
|
|
622
674
|
const claudeSettings = {
|
|
@@ -989,6 +1041,9 @@ switch (command) {
|
|
|
989
1041
|
console.error(`❌ Could not refresh skills: ${err.message}`);
|
|
990
1042
|
}
|
|
991
1043
|
}
|
|
1044
|
+
|
|
1045
|
+
// Ensure session.md is gitignored (fixes existing projects)
|
|
1046
|
+
ensureJettypodGitignores();
|
|
992
1047
|
}
|
|
993
1048
|
|
|
994
1049
|
process.exit(success ? 0 : 1);
|