Skip to content

Commit 1ffaacb

Browse files
committed
refactor(site): remove name argument from site:deploy
The `name` argument for the `site:deploy` command is no longer needed as the site name is now derived from the `--subdomain` option or generated randomly. This change simplifies the command's signature and updates the corresponding help documentation. BREAKING CHANGE: The positional `name` argument has been removed from the `site:deploy` command.
1 parent 90fbba3 commit 1ffaacb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

bin/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ async function main() {
6767
program
6868
.command('site:deploy')
6969
.description('Deploy a local web project to Puter')
70-
.argument('[name]', 'Name of the site')
7170
.argument('[remoteDir]', 'Remote directory path')
7271
.option('--subdomain <subdomain>', 'Subdomain for the site')
7372
.action(async (name, remoteDir, options) => {

src/executor.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ const commands = {
156156
* @param {string} input The command line input
157157
*/
158158
export async function execCommand(context, input) {
159-
const [cmd, ...args] = input.split(' ');
160-
159+
const [cmd, ...args] = input?input.split(' '):[];
161160

162161
// Add the command to history (skip the "history" command itself)
163162
if (cmd !== 'history') {
@@ -355,9 +354,9 @@ function showHelp(command) {
355354
Example: site:create mywebsite /path/to/dir --subdomain=mywebsite
356355
`,
357356
'site:deploy': `
358-
${chalk.cyan('site:deploy [<valid_name_app>] [<remote_dir>] [--subdomain=<subdomain>]')}
357+
${chalk.cyan('site:deploy [<remote_dir>] [--subdomain=<subdomain>]')}
359358
Deploy a local web project to Puter.
360-
Example: site:deploy my-app ./my-app --subdomain my-app
359+
Example: site:deploy ./my-app --subdomain my-app
361360
`,
362361
'!': `
363362
${chalk.cyan('!<command>')}

0 commit comments

Comments
 (0)