diff --git a/src/core/prompt.ts b/src/core/prompt.ts index fc88b25..78b51c5 100644 --- a/src/core/prompt.ts +++ b/src/core/prompt.ts @@ -273,24 +273,6 @@ export function askForHostingFolder(defaultPublicFolderName: string): Promise `Override ${folder}/index.html?`, - when: ({ folder }) => fileExists(`${folder}/index.html`) - }, - { - type: "confirm", - name: "override404", - message: ({ folder }) => `Override ${folder}/404.html?`, - when: ({ folder }) => fileExists(`${folder}/404.html`) - }, - { - type: "confirm", - name: "overrideError", - message: ({ folder }) => `Override ${folder}/error.html?`, - when: ({ folder }) => fileExists(`${folder}/error.html`) } ]; return inquirer.prompt(questions); diff --git a/src/features/hosting/index.ts b/src/features/hosting/index.ts index ed6b974..481f3ed 100644 --- a/src/features/hosting/index.ts +++ b/src/features/hosting/index.ts @@ -10,28 +10,19 @@ module.exports = async function() { let defaultPublicFolder = "./dist"; // default values - let [folder, overrideHtml, override404, overrideError] = [defaultPublicFolder, false, false, false]; + let [folder] = [defaultPublicFolder]; if (isForceModeEnabled) { // when the Force mode is enabled, use all defaults - [folder, overrideHtml, override404, overrideError] = [defaultPublicFolder, true, true, true]; + [folder] = [defaultPublicFolder, true, true, true]; } else { // when either manual or automatic mode are enabled, ask the user for all the details - ({ folder = defaultPublicFolder, overrideHtml, override404, overrideError } = await askForHostingFolder(defaultPublicFolder)); - debug(`selected hosting folder=${folder}, overrideHtml=${overrideHtml}, override404=${override404}. overrideError=${overrideError}`); + ({ folder = defaultPublicFolder } = await askForHostingFolder(defaultPublicFolder)); + debug(`selected hosting folder=${folder}`); } createDirectoryIfNotExists(defaultPublicFolder); - if (override404 || typeof override404 === "undefined") { - // copy 404.html - copyTemplate(`init/hosting/404.html.tpl`, `${folder}/404.html`); - } - if (overrideError || typeof overrideError === "undefined") { - // copy errro.html - copyTemplate(`init/hosting/error.html.tpl`, `${folder}/error.html`); - } - const { storage } = readWorkspace(); debug(`using storage ${chalk.green(storage.name)}`); @@ -40,7 +31,7 @@ module.exports = async function() { // https://docs.microsoft.com/en-us/cli/azure/storage/blob/service-properties?view=azure-cli-latest#az-storage-blob-service-properties-update await az( - `storage blob service-properties update --account-name "${storage.name}" --static-website --404-document 404.html --index-document index.html --query "{staticWebsite: staticWebsite}"`, + `storage blob service-properties update --account-name "${storage.name}" --static-website --404-document index.html --index-document index.html --query "{staticWebsite: staticWebsite}"`, `Enabling hosting for storage account ${chalk.cyan(storage.name)}...` );