Skip to content

Commit

Permalink
Add port option
Browse files Browse the repository at this point in the history
  • Loading branch information
jsines committed Nov 1, 2023
1 parent f65f22b commit 29f801c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/cli/commands/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports.command = 'preview <src> <dest>';
exports.describe = i18n(`${i18nKey}.describe`);

exports.handler = async options => {
const { src, dest, notify, initialUpload, noSsl } = options;
const { src, dest, notify, initialUpload, noSsl, port } = options;

const accountId = getAccountId(options);
const absoluteSrc = path.resolve(getCwd(), src);
Expand All @@ -52,6 +52,7 @@ exports.handler = async options => {
filePaths,
initialUpload,
noSsl,
port,
});
};

Expand Down Expand Up @@ -79,5 +80,9 @@ exports.builder = yargs => {
describe: i18n(`${i18nKey}.options.noSsl.describe`),
type: 'boolean',
});
yargs.option('port', {
describe: i18n(`${i18nKey}.options.port.describe`),
type: 'number',
});
return yargs;
};
2 changes: 2 additions & 0 deletions packages/cli/lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@ en:
describe: "Upload directory before watching for updates"
noSsl:
describe: "Disable HTTPS"
port:
describe: "The port on which to start the local server"
convertFields:
describe: "Converts a specific JavaScript fields file of a module or theme to JSON"
positionals:
Expand Down

0 comments on commit 29f801c

Please sign in to comment.