update pake-cli to 2.0.0-alpha2
This commit is contained in:
3
bin/utils/shell.ts
vendored
3
bin/utils/shell.ts
vendored
@@ -1,9 +1,8 @@
|
||||
import shelljs from "shelljs";
|
||||
import { npmDirectory } from "./dir.js";
|
||||
|
||||
export function shellExec(command: string) {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
shelljs.exec(command, { async: true, silent: false, cwd: npmDirectory }, (code) => {
|
||||
shelljs.exec(command, { async: true, silent: false }, (code) => {
|
||||
if (code === 0) {
|
||||
resolve(0);
|
||||
} else {
|
||||
|
||||
4
bin/utils/url.ts
vendored
4
bin/utils/url.ts
vendored
@@ -20,7 +20,7 @@ export function getDomain(inputUrl: string) {
|
||||
i === 0 || // 'asia.com' (last remaining must be the SLD)
|
||||
i < ln - 2 || // TLDs only span 2 levels
|
||||
part.length < minLength || // 'www.cn.com' (valid TLD as second-level domain)
|
||||
tlds.indexOf(part) < 0 // officially not a TLD
|
||||
tlds.indexOf(part) < 0 // officialy not a TLD
|
||||
) {
|
||||
return part;
|
||||
}
|
||||
@@ -42,6 +42,6 @@ export function normalizeUrl(urlToNormalize: string): string {
|
||||
if (isurl(urlWithProtocol)) {
|
||||
return urlWithProtocol;
|
||||
} else {
|
||||
throw new Error(`The URL "${urlWithProtocol}" you provided is invalid.`);
|
||||
throw new Error(`Your url "${urlWithProtocol}" is invalid`);
|
||||
}
|
||||
}
|
||||
|
||||
2
bin/utils/validate.ts
vendored
2
bin/utils/validate.ts
vendored
@@ -5,7 +5,7 @@ import fs from 'fs';
|
||||
export function validateNumberInput(value: string) {
|
||||
const parsedValue = Number(value);
|
||||
if (isNaN(parsedValue)) {
|
||||
throw new Commander.InvalidArgumentError('The input cannot be a number.');
|
||||
throw new Commander.InvalidArgumentError('Not a number.');
|
||||
}
|
||||
return parsedValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user