feat(create-pca): support optional config file output
This commit is contained in:
@@ -238,12 +238,19 @@ Options:
|
|||||||
} else {
|
} else {
|
||||||
console.log(`Created application '${appName}'`);
|
console.log(`Created application '${appName}'`);
|
||||||
}
|
}
|
||||||
console.log(`appId: ${appId}`);
|
const configTemplate = `export const config = {
|
||||||
console.log(`export const config = {
|
|
||||||
"appName": "${appName}",
|
"appName": "${appName}",
|
||||||
"tenantId": "${tenantId}",
|
"tenantId": "${tenantId}",
|
||||||
"clientId": "${appId}"
|
"clientId": "${appId}"
|
||||||
};`);
|
};`;
|
||||||
|
|
||||||
|
if (configPath) {
|
||||||
|
const targetPath = path.resolve(configPath);
|
||||||
|
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
||||||
|
fs.writeFileSync(targetPath, `${configTemplate}\n`, "utf8");
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(configTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user