| 
7 | 7 |   mkdirpSync,  | 
8 | 8 |   mkdirSync,  | 
9 | 9 |   realpathSync,  | 
 | 10 | +  removeSync,  | 
10 | 11 |   writeFileSync,  | 
11 | 12 | } from "fs-extra"  | 
12 |  | -import { sync as rimraf } from "rimraf"  | 
13 | 13 | import { dirSync } from "tmp"  | 
14 | 14 | import { gzipSync } from "zlib"  | 
15 | 15 | import { applyPatch } from "./applyPatches"  | 
@@ -254,11 +254,11 @@ export function makePatch({  | 
254 | 254 |       })  | 
255 | 255 | 
 
  | 
256 | 256 |     // remove nested node_modules just to be safe  | 
257 |  | -    rimraf(join(tmpRepoPackagePath, "node_modules"))  | 
 | 257 | +    removeSync(join(tmpRepoPackagePath, "node_modules"))  | 
258 | 258 |     // remove .git just to be safe  | 
259 |  | -    rimraf(join(tmpRepoPackagePath, ".git"))  | 
 | 259 | +    removeSync(join(tmpRepoPackagePath, ".git"))  | 
260 | 260 |     // remove patch-package state file  | 
261 |  | -    rimraf(join(tmpRepoPackagePath, STATE_FILE_NAME))  | 
 | 261 | +    removeSync(join(tmpRepoPackagePath, STATE_FILE_NAME))  | 
262 | 262 | 
 
  | 
263 | 263 |     // commit the package  | 
264 | 264 |     console.info(chalk.grey("•"), "Diffing your files with clean files")  | 
@@ -292,17 +292,17 @@ export function makePatch({  | 
292 | 292 |     git("commit", "--allow-empty", "-m", "init")  | 
293 | 293 | 
 
  | 
294 | 294 |     // replace package with user's version  | 
295 |  | -    rimraf(tmpRepoPackagePath)  | 
 | 295 | +    removeSync(tmpRepoPackagePath)  | 
296 | 296 | 
 
  | 
297 | 297 |     // pnpm installs packages as symlinks, copySync would copy only the symlink  | 
298 | 298 |     copySync(realpathSync(packagePath), tmpRepoPackagePath)  | 
299 | 299 | 
 
  | 
300 | 300 |     // remove nested node_modules just to be safe  | 
301 |  | -    rimraf(join(tmpRepoPackagePath, "node_modules"))  | 
 | 301 | +    removeSync(join(tmpRepoPackagePath, "node_modules"))  | 
302 | 302 |     // remove .git just to be safe  | 
303 |  | -    rimraf(join(tmpRepoPackagePath, ".git"))  | 
 | 303 | +    removeSync(join(tmpRepoPackagePath, ".git"))  | 
304 | 304 |     // remove patch-package state file  | 
305 |  | -    rimraf(join(tmpRepoPackagePath, STATE_FILE_NAME))  | 
 | 305 | +    removeSync(join(tmpRepoPackagePath, STATE_FILE_NAME))  | 
306 | 306 | 
 
  | 
307 | 307 |     // also remove ignored files like before  | 
308 | 308 |     removeIgnoredFiles(tmpRepoPackagePath, includePaths, excludePaths)  | 
 | 
0 commit comments