Skip to content

Commit

Permalink
fix: memory leak (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad authored Oct 1, 2024
1 parent 4628305 commit 2ab1540
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
20 changes: 18 additions & 2 deletions packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,36 @@ const main = defineCommand({
},
},
run: async ({ args }) => {
const paths = args._.length > 0
const paths = args._.length
? await glob(args._, {
expandDirectories: false,
onlyDirectories: true,
absolute: true,
})
: [process.cwd()];

const templates = await glob(args.template ?? [], {
if (args._.includes(".") || args._.includes("./")) {
paths.push(process.cwd());
}

const templatePatterns =
typeof args.template === "string"
? [args.template]
: ([...(args.template || [])] as string[]);

const templates = await glob(templatePatterns, {
expandDirectories: false,
onlyDirectories: true,
absolute: true,
});

if (
templatePatterns.includes(".") ||
templatePatterns.includes("./")
) {
templates.push(process.cwd());
}

const formData = new FormData();

const isCompact = !!args.compact;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"package-manager-detector": "^0.1.2",
"pkg-types": "^1.1.1",
"query-registry": "^3.0.1",
"tinyglobby": "^0.2.7"
"tinyglobby": "0.2.6"
},
"devDependencies": {
"@pkg-pr-new/utils": "workspace:^",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ab1540

Please sign in to comment.