Skip to content

Commit 90fbba3

Browse files
authored
Merge pull request #24 from reynaldichernando/valid-site-app-deploy
Use random name if not specified for `site:deploy`
2 parents 6702afb + 48ae3f0 commit 90fbba3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/commands/deploy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import { getSubdomains } from './subdomains.js';
77

88
/**
99
* Deploy a local web project to Puter.
10-
* @param {string[]} args - Command-line arguments (e.g., <valid_site_app> [<remote_dir>] [--subdomain=<subdomain>]).
10+
* @param {string[]} args - Command-line arguments (e.g., [<remote_dir>] [--subdomain=<subdomain>]).
1111
*/
1212
export async function deploy(args = []) {
1313
if (args.length < 1 || !isValidAppName(args[0])) {
14-
console.log(chalk.red('Usage: site:deploy <valid_site_app> [<remote_dir>] [--subdomain=<subdomain>]'));
14+
console.log(chalk.red('Usage: site:deploy [<remote_dir>] [--subdomain=<subdomain>]'));
1515
console.log(chalk.yellow('Example: site:deploy'));
16-
console.log(chalk.yellow('Example: site:deploy my-app'));
17-
console.log(chalk.yellow('Example: site:deploy my-app ./my-app'));
18-
console.log(chalk.yellow('Example: site:deploy my-app ./my-app --subdomain=my-app-new'));
16+
console.log(chalk.yellow('Example: site:deploy'));
17+
console.log(chalk.yellow('Example: site:deploy ./my-app'));
18+
console.log(chalk.yellow('Example: site:deploy ./my-app --subdomain=my-app-new'));
1919
return;
2020
}
21-
const appName = args[0]; // && !args[0].startsWith('--') ? args[0] : generateAppName();
21+
const appName = generateAppName();
2222
const remoteDirArg = args.find(arg => !arg.startsWith('--') && arg !== appName);
2323
const remoteDir = remoteDirArg || '.'; // `./${appName}`;
2424
const subdomain = args.find(arg => arg.startsWith('--subdomain='))?.split('=')[1] || appName;

0 commit comments

Comments
 (0)