Skip to content

Commit 43bc9e6

Browse files
chore: feedback from Esteban
1 parent 7f13adc commit 43bc9e6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/commands/agent/generate/authoring-bundle.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
8484
const defaultOutputDir = join(this.project!.getDefaultPackage().fullPath, 'main', 'default', 'aiAuthoringBundle');
8585
const targetOutputDir = join(outputDir ?? defaultOutputDir, name);
8686

87-
// Create output directory if it doesn't exist
88-
mkdirSync(targetOutputDir, { recursive: true });
89-
9087
// Generate file paths
9188
const afScriptPath = join(targetOutputDir, `${name}.afscript`);
9289
const metaXmlPath = join(targetOutputDir, `${name}.authoring-bundle-meta.xml`);
@@ -95,10 +92,12 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
9592
const conn = targetOrg.getConnection(flags['api-version']);
9693
const specContents = YAML.parse(readFileSync(spec, 'utf8')) as AgentJobSpec;
9794
const afScript = await Agent.createAfScript(conn, specContents);
95+
// Create output directory if it doesn't exist
96+
mkdirSync(targetOutputDir, { recursive: true });
9897
writeFileSync(afScriptPath, afScript);
9998

10099
// Write meta.xml file
101-
const metaXml = `<?xml version="1" encoding="UTF-8"?>
100+
const metaXml = `<?xml version="1.0" encoding="UTF-8"?>
102101
<aiAuthoringBundle>
103102
<Label>${specContents.role}</Label>
104103
<BundleType>${specContents.agentType}</BundleType>

0 commit comments

Comments
 (0)