@cliphijack/santaclaude 0.4.0 → 0.5.0
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/santaclaude.js +8 -2
package/package.json
CHANGED
package/santaclaude.js
CHANGED
|
@@ -81,8 +81,14 @@ async function run(conf) {
|
|
|
81
81
|
try {
|
|
82
82
|
if (cmd.action === 'create') {
|
|
83
83
|
if (paneExists(cmd.name)) { console.log(` 🦌 "${cmd.name}" 이미 있어 — 새로 안 띄움`); return; }
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
let cwd = cmd.cwd ? String(cmd.cwd).trim() : '';
|
|
85
|
+
if (cwd) {
|
|
86
|
+
if (cwd === '~' || cwd.startsWith('~/')) cwd = path.join(os.homedir(), cwd.slice(1)); // ~ 확장
|
|
87
|
+
try { fs.mkdirSync(cwd, { recursive: true }); } // 폴더 없으면 새로 생성
|
|
88
|
+
catch (e) { console.warn(` ⚠️ 폴더 생성 실패(${cwd}): ${e.message} — 홈에서 띄움`); cwd = ''; }
|
|
89
|
+
}
|
|
90
|
+
spawnClaude(cmd.name, claudeCmd, cwd || undefined);
|
|
91
|
+
console.log(` 🦌 새 루돌프 "${cmd.name}"${cwd ? ' @' + cwd + ' (폴더 준비됨)' : ''} 띄움 (tmux attach -t ${cmd.name} 로 로그인 1회)`);
|
|
86
92
|
} else if (cmd.action === 'kill') {
|
|
87
93
|
execFileSync('tmux', ['kill-session', '-t', cmd.name]);
|
|
88
94
|
console.log(` 💤 루돌프 "${cmd.name}" 닫음`);
|