Skip to content

Commit 5e39948

Browse files
committed
refactor(deploy): update argument validation and remote directory handling
1 parent 1ffaacb commit 5e39948

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/deploy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getSubdomains } from './subdomains.js';
1010
* @param {string[]} args - Command-line arguments (e.g., [<remote_dir>] [--subdomain=<subdomain>]).
1111
*/
1212
export async function deploy(args = []) {
13-
if (args.length < 1 || !isValidAppName(args[0])) {
13+
if (args.length > 2 || args.some(arg => arg.startsWith('--') && !arg.startsWith('--subdomain='))) {
1414
console.log(chalk.red('Usage: site:deploy [<remote_dir>] [--subdomain=<subdomain>]'));
1515
console.log(chalk.yellow('Example: site:deploy'));
1616
console.log(chalk.yellow('Example: site:deploy'));
@@ -19,8 +19,8 @@ export async function deploy(args = []) {
1919
return;
2020
}
2121
const appName = generateAppName();
22-
const remoteDirArg = args.find(arg => !arg.startsWith('--') && arg !== appName);
23-
const remoteDir = remoteDirArg || '.'; // `./${appName}`;
22+
const remoteDirArg = args.find(arg => !arg.startsWith('--'));
23+
const remoteDir = remoteDirArg || '.';
2424
const subdomain = args.find(arg => arg.startsWith('--subdomain='))?.split('=')[1] || appName;
2525
const sourceDir = '.'; // Deploy from the current directory
2626

0 commit comments

Comments
 (0)