Skip to content

Commit

Permalink
Revert "chore: replace glob by globby to cleanup temp files (#605)…
Browse files Browse the repository at this point in the history
…" (#606)

This reverts commit 56484ee.
  • Loading branch information
ghiscoding committed May 16, 2023
1 parent 56484ee commit d940322
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"file-url": "^4.0.0",
"find-up": "^6.3.0",
"fs-extra": "^11.1.1",
"glob": "^10.2.2",
"globby": "^13.1.4",
"load-json-file": "^7.0.1",
"normalize-newline": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"chalk": "^5.2.0",
"columnify": "^1.6.0",
"fs-extra": "^11.1.1",
"globby": "^13.1.4",
"glob": "^10.2.2",
"has-unicode": "^2.0.1",
"libnpmaccess": "^7.0.2",
"libnpmpublish": "^7.1.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/publish/src/publish-command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { globby } from 'globby';
import { glob } from 'glob';
import { outputFileSync, removeSync } from 'fs-extra/esm';
import { EOL } from 'node:os';
import { join, relative } from 'node:path';
Expand Down Expand Up @@ -324,7 +324,7 @@ export class PublishCommand extends Command<PublishCommandOption> {

// optionally cleanup temp packed files after publish, opt-in option
if (this.options.cleanupTempFiles) {
globby(normalizePath(join(tempDir, '/lerna-*'))).then((deleteFolders) => {
glob(normalizePath(join(tempDir, '/lerna-*'))).then((deleteFolders) => {
// delete silently all files/folders that startsWith "lerna-"
deleteFolders.forEach((folder) => removeSync(folder));
this.logger.verbose('publish', `Found ${deleteFolders.length} temp folders to cleanup after publish.`);
Expand Down
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions scripts/cleanup-temp-files.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { globby } from 'globby';
import { glob } from 'glob';
import { join } from 'node:path';
import { removeSync } from 'fs-extra/esm';
import tempDir from 'temp-dir';
import normalizePath from 'normalize-path';

globby(normalizePath(join(tempDir, '/lerna-*'))).then((deleteFolders) => {
glob(normalizePath(join(tempDir, '/lerna-*'))).then((deleteFolders) => {
// delete silently all files/folders that startsWith "lerna-"
console.log(`Found ${deleteFolders.length} temp folders to cleanup.`);
(deleteFolders || []).forEach((folder) => removeSync(folder));
Expand Down

0 comments on commit d940322

Please sign in to comment.