binary-agents 1.1.0 → 1.1.1

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/README.md CHANGED
@@ -30,8 +30,8 @@ npx binary-agents list
30
30
  에이전트만
31
31
  명령어만
32
32
 
33
- ? 기존 파일을 삭제하고 새로 설치할까요?
34
- ❯ 예 (기존 파일 삭제)
33
+ ? 기존 binary-agents 파일을 삭제하고 새로 설치할까요?
34
+ ❯ 예 (binary-agents 파일만 삭제, 커스텀 파일 보존)
35
35
  아니오 (기존 파일 유지)
36
36
  ```
37
37
 
package/bin/cli.js CHANGED
@@ -44,9 +44,9 @@ async function main() {
44
44
 
45
45
  // 3. 기존 파일 삭제 여부
46
46
  const clean = await select({
47
- message: '기존 파일을 삭제하고 새로 설치할까요?',
47
+ message: '기존 binary-agents 파일을 삭제하고 새로 설치할까요?',
48
48
  choices: [
49
- { name: '예 (기존 파일 삭제)', value: true },
49
+ { name: '예 (binary-agents 파일만 삭제, 커스텀 파일 보존)', value: true },
50
50
  { name: '아니오 (기존 파일 유지)', value: false }
51
51
  ]
52
52
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binary-agents",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Claude Code subagents and slash commands collection with sync CLI tool",
5
5
  "type": "module",
6
6
  "main": "src/sync.js",
package/src/sync.js CHANGED
@@ -117,18 +117,20 @@ async function saveFile(agentsDir, filename, content) {
117
117
  }
118
118
 
119
119
  /**
120
- * 디렉토리 .md 파일 삭제
120
+ * binary-agents로 설치된 파일만 삭제
121
+ * @param {string} dirPath - 대상 디렉토리
122
+ * @param {string[]} targetFiles - 삭제할 파일명 목록
121
123
  */
122
- async function cleanDirectory(dirPath) {
124
+ async function cleanDirectory(dirPath, targetFiles) {
123
125
  try {
124
- const files = await fs.readdir(dirPath);
125
- const mdFiles = files.filter(f => f.endsWith('.md'));
126
+ const existingFiles = await fs.readdir(dirPath);
127
+ const filesToDelete = existingFiles.filter(f => targetFiles.includes(f));
126
128
 
127
- for (const file of mdFiles) {
129
+ for (const file of filesToDelete) {
128
130
  await fs.unlink(path.join(dirPath, file));
129
131
  }
130
132
 
131
- return mdFiles.length;
133
+ return filesToDelete.length;
132
134
  } catch {
133
135
  return 0;
134
136
  }
@@ -168,11 +170,11 @@ async function syncAgentsOnly(options = {}) {
168
170
  return { success: false, error: error.message, type: 'agents' };
169
171
  }
170
172
 
171
- // clean 옵션이 있으면 기존 파일 삭제
173
+ // clean 옵션이 있으면 binary-agents 파일만 삭제
172
174
  if (clean) {
173
- const cleanSpinner = ora('Cleaning existing agent files...').start();
174
- const deletedCount = await cleanDirectory(agentsDir);
175
- cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount} existing files`));
175
+ const cleanSpinner = ora('Cleaning binary-agents files...').start();
176
+ const deletedCount = await cleanDirectory(agentsDir, filesToSync);
177
+ cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount} binary-agents files`));
176
178
  }
177
179
 
178
180
  // 각 파일 복사
@@ -238,11 +240,11 @@ async function syncCommandsOnly(options = {}) {
238
240
  return { success: false, error: error.message, type: 'commands' };
239
241
  }
240
242
 
241
- // clean 옵션이 있으면 기존 파일 삭제
243
+ // clean 옵션이 있으면 binary-agents 파일만 삭제
242
244
  if (clean) {
243
- const cleanSpinner = ora('Cleaning existing command files...').start();
244
- const deletedCount = await cleanDirectory(commandsDir);
245
- cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount} existing files`));
245
+ const cleanSpinner = ora('Cleaning binary-agents files...').start();
246
+ const deletedCount = await cleanDirectory(commandsDir, allFiles);
247
+ cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount} binary-agents files`));
246
248
  }
247
249
 
248
250
  // 각 파일 복사
@@ -287,7 +289,7 @@ export async function syncSubagents(options = {}) {
287
289
  }
288
290
 
289
291
  if (clean) {
290
- console.log(chalk.yellow('🧹 Clean mode: Removing existing files before sync\n'));
292
+ console.log(chalk.yellow('🧹 Clean mode: binary-agents로 설치한 파일만 삭제 (커스텀 파일 보존)\n'));
291
293
  }
292
294
 
293
295
  const syncResults = [];