Skip to content

Commit

Permalink
fix: filter unnamed task
Browse files Browse the repository at this point in the history
  • Loading branch information
linbudu599 committed Mar 29, 2022
1 parent b9eb30c commit d91d8bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ci:publish": "pnpm build:all && pnpm changeset publish",
"ci:version": "changeset version && pnpm install --no-frozen-lockfile && git add .",
"cli": "ts-node -P scripts/tsconfig.script.json scripts/cli.ts",
"cli-dev": "pnpm cli --respawn --transpile-only",
"cli-dev": "ts-node -P scripts/tsconfig.script.json --transpile-only scripts/cli.ts",
"cs:add": "changeset add",
"cs:publish": "changeset publish",
"cs:tag": "changeset tag",
Expand Down
8 changes: 5 additions & 3 deletions scripts/rename-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ export default function useRenameWorkspacePackage(cli: CAC) {
tasks.push([pkg, renamed]);
}

if (!tasks.length) {
consola.error('No copy tasks available.');
const filteredTasks = tasks.filter((t) => t[1].length);

if (!filteredTasks.length) {
consola.error('No rename task available.');
}

for (const [raw, renamed] of tasks) {
for (const [raw, renamed] of filteredTasks) {
const rawDir = CLIUtils.resolvePackageDir(raw);
const dest = CLIUtils.resolvePackageDir(renamed);

Expand Down

0 comments on commit d91d8bb

Please sign in to comment.