binary-agents 1.0.22 → 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 +2 -2
- package/bin/cli.js +2 -2
- package/package.json +4 -2
- package/src/sync.js +17 -15
package/README.md
CHANGED
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: '예 (
|
|
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.
|
|
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",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start": "node bin/cli.js",
|
|
12
12
|
"list": "node bin/cli.js list",
|
|
13
|
-
"release": "npm version patch && npm publish"
|
|
13
|
+
"release": "npm version patch && npm publish",
|
|
14
|
+
"release:minor": "npm version minor && npm publish",
|
|
15
|
+
"release:major": "npm version major && npm publish"
|
|
14
16
|
},
|
|
15
17
|
"keywords": [
|
|
16
18
|
"claude",
|
package/src/sync.js
CHANGED
|
@@ -117,18 +117,20 @@ async function saveFile(agentsDir, filename, content) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
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
|
|
125
|
-
const
|
|
126
|
+
const existingFiles = await fs.readdir(dirPath);
|
|
127
|
+
const filesToDelete = existingFiles.filter(f => targetFiles.includes(f));
|
|
126
128
|
|
|
127
|
-
for (const file of
|
|
129
|
+
for (const file of filesToDelete) {
|
|
128
130
|
await fs.unlink(path.join(dirPath, file));
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
return
|
|
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
|
|
174
|
-
const deletedCount = await cleanDirectory(agentsDir);
|
|
175
|
-
cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount}
|
|
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
|
|
244
|
-
const deletedCount = await cleanDirectory(commandsDir);
|
|
245
|
-
cleanSpinner.succeed(chalk.green(`Cleaned ${deletedCount}
|
|
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:
|
|
292
|
+
console.log(chalk.yellow('🧹 Clean mode: binary-agents로 설치한 파일만 삭제 (커스텀 파일 보존)\n'));
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
const syncResults = [];
|