@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/santaclaude.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliphijack/santaclaude",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "publishConfig": { "access": "public" },
5
5
  "description": "SantaClaude 커넥터 — 클라우드 예약을 내 로컬 Claude(tmux)에 발사",
6
6
  "bin": { "santaclaude": "./santaclaude.js" },
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
- spawnClaude(cmd.name, claudeCmd, cmd.cwd || undefined);
85
- console.log(` 🦌 새 루돌프 "${cmd.name}"${cmd.cwd ? ' @' + cmd.cwd : ''} 띄움 (tmux attach -t ${cmd.name} 로 로그인 1회)`);
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}" 닫음`);