Skip to content

Commit

Permalink
retry outputLocation as absolute location
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikun committed Oct 20, 2023
1 parent 0969ebe commit a68c403
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/cli/commands/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ export async function deploy(options: SWACLIConfig) {
}
}

// make sure outputLocation is set
const resolvedOutputLocation = path.resolve(appLocation, outputLocation || process.cwd());
logger.silly(`Resolving outputLocation=${outputLocation} full path...`);
let resolvedOutputLocation = path.resolve(appLocation, outputLocation as string);

// if folder exists, deploy from a specific build folder (outputLocation), relative to appLocation
if (!fs.existsSync(resolvedOutputLocation)) {
logger.error(`The folder "${resolvedOutputLocation}" is not found. Exit.`, true);
return;
if (!fs.existsSync(outputLocation as string)) {
logger.error(`The folder "${resolvedOutputLocation}" is not found. Exit.`, true);
return;
}
// otherwise, build folder (outputLocation) is using the absolute location
resolvedOutputLocation = path.resolve(outputLocation as string);
}

logger.log(`Deploying front-end files from folder:`);
Expand Down

0 comments on commit a68c403

Please sign in to comment.