Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Updated generator top copy new ARM template structure #4287

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions generators/generator-botbuilder/components/commonFilesWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,35 @@ module.exports.commonFilesWriter = (generator, templatePath) => {
);

// gen the deployment/Templates folder
const deploymentFolder = 'deploymentTemplates';
const deploymentFolders = ['deploymentTemplates/deployUseExistResourceGroup','deploymentTemplates/deployWithNewResourceGroup'];
const deploymentFiles = [
'template-with-new-rg.json',
'template-with-preexisting-rg.json',
'new-rg-parameters.json',
'preexisting-rg-parameters.json',
[
'parameters-for-template-AzureBot-with-rg.json',
'parameters-for-template-BotApp-with-rg.json',
'readme.md',
'template-AzureBot-with-rg.json',
'template-BotApp-with-rg.json',
],
[
'parameters-for-template-AzureBot-new-rg.json',
'parameters-for-template-BotApp-new-rg.json',
'readme.md',
'template-AzureBot-new-rg.json',
'template-BotApp-new-rg.json',
]
];
mkdirp.sync(deploymentFolder);
const sourcePath = path.join(templatePath, deploymentFolder);
const destinationPath = path.join(generator.destinationPath(), deploymentFolder);
for(let cnt = 0; cnt < deploymentFiles.length; ++cnt) {
generator.fs.copy(
path.join(sourcePath, deploymentFiles[cnt]),
path.join(destinationPath, deploymentFiles[cnt]),
);

for (let i = 0; i < deploymentFolders.length; i++) {
const deploymentFolder = deploymentFolders[i];
mkdirp.sync(deploymentFolder);
const sourcePath = path.join(templatePath, deploymentFolder);
const destinationPath = path.join(generator.destinationPath(), deploymentFolder);

for(let cnt = 0; cnt < deploymentFiles[i].length; ++cnt) {
generator.fs.copy(
path.join(sourcePath, deploymentFiles[i][cnt]),
path.join(destinationPath, deploymentFiles[i][cnt]),
);
}
}
}