Skip to content

Commit 040c910

Browse files
committed
feat: prompt for directory path when manual IDE is selected interactively
1 parent f58c5da commit 040c910

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

packages/b2c-cli/src/commands/setup/skills.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
55
*/
66
import {Args, Flags, ux} from '@oclif/core';
7-
import {checkbox, confirm} from '@inquirer/prompts';
7+
import {checkbox, confirm, input} from '@inquirer/prompts';
88
import {BaseCommand, createTable, type ColumnDef} from '@salesforce/b2c-tooling-sdk/cli';
99
import {
1010
type IdeType,
@@ -273,12 +273,17 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
273273
}
274274
}
275275

276+
// Prompt for manual installation directory
277+
let directory = this.flags.directory;
278+
if (targetIdes.includes('manual') && !directory && !this.flags.force) {
279+
directory = await input({
280+
message: t('commands.setup.skills.manualDirectory', 'Installation directory:'),
281+
default: '.agents/skills',
282+
});
283+
}
284+
276285
// Show installation preview
277-
const scope = this.flags.directory
278-
? `directory: ${this.flags.directory}`
279-
: this.flags.global
280-
? 'global (user home)'
281-
: 'project';
286+
const scope = directory ? `directory: ${directory}` : this.flags.global ? 'global (user home)' : 'project';
282287
ux.stdout('');
283288
ux.stdout(
284289
t('commands.setup.skills.preview', 'Installing {{count}} skills to {{ides}} ({{scope}})', {
@@ -310,7 +315,7 @@ export default class SetupSkills extends BaseCommand<typeof SetupSkills> {
310315
global: this.flags.global,
311316
update: this.flags.update,
312317
projectRoot: process.cwd(),
313-
directory: this.flags.directory,
318+
directory,
314319
});
315320
})
316321
.filter((p): p is Promise<InstallSkillsResult> => p !== null);

0 commit comments

Comments
 (0)