@sylphx/flow 1.4.3 → 1.4.4
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
CHANGED
|
@@ -168,6 +168,11 @@ export async function installComponents(
|
|
|
168
168
|
if (target.setupAgents && options.agents !== false) {
|
|
169
169
|
const agentSpinner = quiet ? null : ora({ text: 'Installing agents', color: 'cyan' }).start();
|
|
170
170
|
try {
|
|
171
|
+
// DEBUG: Log force flag
|
|
172
|
+
if (!quiet && options.clear) {
|
|
173
|
+
console.log(`[DEBUG] Installing agents with force=${options.clear}`);
|
|
174
|
+
}
|
|
175
|
+
|
|
171
176
|
const agentResult = await target.setupAgents(process.cwd(), { ...options, quiet: true, force: options.clear });
|
|
172
177
|
result.installed.agents = agentResult.count;
|
|
173
178
|
|
|
@@ -247,6 +252,11 @@ export async function installComponents(
|
|
|
247
252
|
color: 'cyan',
|
|
248
253
|
}).start();
|
|
249
254
|
try {
|
|
255
|
+
// DEBUG: Log force flag
|
|
256
|
+
if (!quiet && options.clear) {
|
|
257
|
+
console.log(`[DEBUG] Installing slash commands with force=${options.clear}`);
|
|
258
|
+
}
|
|
259
|
+
|
|
250
260
|
const commandsResult = await target.setupSlashCommands(process.cwd(), { ...options, quiet: true, force: options.clear });
|
|
251
261
|
result.installed.slashCommands = commandsResult.count;
|
|
252
262
|
|
|
@@ -124,9 +124,25 @@ export async function installToDirectory(
|
|
|
124
124
|
let content = fs.readFileSync(sourcePath, 'utf8');
|
|
125
125
|
content = await transform(content, file);
|
|
126
126
|
|
|
127
|
+
// DEBUG: Log installation details
|
|
128
|
+
if (options.force && !options.quiet) {
|
|
129
|
+
console.log(
|
|
130
|
+
`[DEBUG] Installing ${file} - force=${options.force}, exists=${!!localInfo}, path=${targetPath}`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
127
134
|
// Force mode: always overwrite without checking
|
|
128
135
|
if (options.force) {
|
|
129
136
|
fs.writeFileSync(targetPath, content, 'utf8');
|
|
137
|
+
|
|
138
|
+
// DEBUG: Verify write
|
|
139
|
+
if (!options.quiet) {
|
|
140
|
+
const written = fs.existsSync(targetPath);
|
|
141
|
+
if (!written) {
|
|
142
|
+
console.warn(`[DEBUG] Failed to write: ${targetPath}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
130
146
|
results.push({
|
|
131
147
|
file,
|
|
132
148
|
status: localInfo ? 'updated' : 'added',
|
package/src/utils/sync-utils.ts
CHANGED
|
@@ -388,12 +388,25 @@ export async function executeSyncDelete(
|
|
|
388
388
|
// Delete Flow templates
|
|
389
389
|
for (const file of flowFiles) {
|
|
390
390
|
try {
|
|
391
|
+
const existsBefore = fs.existsSync(file);
|
|
392
|
+
if (!existsBefore) {
|
|
393
|
+
console.log(chalk.dim(` ⊘ Already deleted: ${path.basename(file)}`));
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
|
|
391
397
|
await fs.promises.unlink(file);
|
|
392
|
-
|
|
393
|
-
|
|
398
|
+
|
|
399
|
+
// Verify deletion
|
|
400
|
+
const existsAfter = fs.existsSync(file);
|
|
401
|
+
if (existsAfter) {
|
|
402
|
+
console.warn(chalk.yellow(` ⚠ File still exists after deletion: ${path.basename(file)}`));
|
|
403
|
+
} else {
|
|
404
|
+
console.log(chalk.dim(` ✓ Deleted: ${path.basename(file)}`));
|
|
405
|
+
templatesDeleted++;
|
|
406
|
+
}
|
|
394
407
|
} catch (error) {
|
|
395
408
|
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
|
|
396
|
-
console.warn(chalk.yellow(` ⚠ Failed to delete: ${path.basename(file)}`));
|
|
409
|
+
console.warn(chalk.yellow(` ⚠ Failed to delete: ${path.basename(file)} - ${error}`));
|
|
397
410
|
}
|
|
398
411
|
}
|
|
399
412
|
}
|