Skip to content

Commit

Permalink
fromatted the code and in substring used number instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Jan 4, 2024
1 parent 8ed371e commit 9b57828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/src/bootstrap/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export async function inquireLivePreviewSupport() {
}

export async function continueBootstrapCommand() {
const {shouldContinue} = await inquirer.prompt({
const { shouldContinue } = await inquirer.prompt({
type: 'list',
name: 'shouldContinue',
message: `Do you still want to complete the bootstrap command with Live Preview Disabled?`,
choices: ['yes', 'no'],
loop: false,
})
});
return shouldContinue;
}
8 changes: 5 additions & 3 deletions packages/contentstack-bootstrap/src/bootstrap/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ const envFileHandler = async (
let customHost;
let previewHost: string;
const regionName = region && region.name && region.name.toLowerCase();
previewHost = region.cda?.substring('8').replace('cdn', 'rest-preview');
previewHost = region.cda?.substring(8).replace('cdn', 'rest-preview');
const isUSRegion = regionName === 'us' || regionName === 'na';
if (regionName !== 'eu' && !isUSRegion) {
customHost = region.cda && region.cda.substring('8');
customHost = region.cda && region.cda.substring(8);
customHost = customHost.replace('cdn', 'rest-preview');
}
const production = environmentVariables.environment === 'production' ? true : false;
Expand Down Expand Up @@ -195,7 +195,9 @@ const envFileHandler = async (
customHost ?? previewHost
}\n`
: '\n'
}CONTENTSTACK_APP_HOST=''\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
}CONTENTSTACK_APP_HOST=''\nCONTENTSTACK_ENVIRONMENT=${
environmentVariables.environment
}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
result = await writeEnvFile(content, filePath);
break;
case 'angular':
Expand Down

0 comments on commit 9b57828

Please sign in to comment.