File tree Expand file tree Collapse file tree 9 files changed +18
-18
lines changed
include-exclude-regex-relativity Expand file tree Collapse file tree 9 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ echo 'install without error because package.json is sanitized'
44yarn add $1
55
66echo ' unsnitize package.json'
7- replace ' <<PREINSTALL>>' preinstall package.json
7+ npx replace ' <<PREINSTALL>>' preinstall package.json
88
99echo ' install fails because preinstall hook is bad'
1010if yarn; then
1111 exit 1
1212fi
1313
14- replace leftPad patchPackage node_modules/left-pad/index.js
14+ npx replace leftPad patchPackage node_modules/left-pad/index.js
1515
1616echo ' but patch-package still works because it ignores scripts'
1717npx patch-package left-pad
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ cat patches/left-pad+1.1.3.patch
2121echo " END SNAPSHOT"
2222
2323echo " reinstall node_modules"
24- rimraf node_modules
24+ npx rimraf node_modules
2525npm i
2626
2727echo " patch-package didn't run"
@@ -33,7 +33,7 @@ echo "add patch-package to postinstall hook"
3333node ./add-postinstall.js
3434
3535echo " reinstall node_modules"
36- rimraf node_modules
36+ npx rimraf node_modules
3737npm i
3838
3939echo " patch-package did run"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ echo "Add left-pad"
88yarn add left-pad@1.1.3
99
1010echo " replace pad with yarn in left-pad/index.js"
11- replace pad yarn node_modules/left-pad/index.js
11+ npx replace pad yarn node_modules/left-pad/index.js
1212
1313echo " SNAPSHOT: making patch"
1414npx patch-package left-pad
@@ -19,7 +19,7 @@ cat patches/left-pad+1.1.3.patch
1919echo " END SNAPSHOT"
2020
2121echo " reinstall node_modules"
22- rimraf node_modules
22+ npx rimraf node_modules
2323yarn
2424
2525echo " patch-package didn't run"
@@ -31,7 +31,7 @@ echo "add patch-package to postinstall hook"
3131node ./add-postinstall.js
3232
3333echo " reinstall node_modules"
34- rimraf node_modules
34+ npx rimraf node_modules
3535yarn
3636
3737echo " patch-package did run"
Original file line number Diff line number Diff line change 1717
1818echo " make a change to line a"
1919node strip-whitespace.js
20- replace ' a' ' patch-package' node_modules/alphabet/index.js
20+ npx replace ' a' ' patch-package' node_modules/alphabet/index.js
2121node add-whitespace.js 2
2222
2323echo " make patch file for line a"
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ echo "add patch-package"
55yarn add $1
66
77echo " edit some files"
8- replace exports patchPackage node_modules/lodash/_baseClamp.js
9- replace exports patchPackage node_modules/lodash/_baseClone.js
10- replace exports patchPackage node_modules/lodash/flip.js
8+ npx replace exports patchPackage node_modules/lodash/_baseClamp.js
9+ npx replace exports patchPackage node_modules/lodash/_baseClone.js
10+ npx replace exports patchPackage node_modules/lodash/flip.js
1111
1212echo " add a file"
1313echo " this is a new file" > node_modules/lodash/newFile.md
5555echo " run patch package including newFile (case insensitive)"
5656npx patch-package lodash --include newFile --case-sensitive-path-filtering
5757
58- echo " revet to the beginning"
59- rimraf node_modules
58+ echo " revert to the beginning"
59+ npx rimraf node_modules
6060yarn
6161
6262echo " edit lodash's package.json"
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo "add patch-package"
55yarn add $1
66
77echo " mutate words.js"
8- replace words patch-packages node_modules/lodash/words.js
8+ npx replace words patch-packages node_modules/lodash/words.js
99
1010echo " patch-package includes words.js in a patch by default"
1111npx patch-package lodash
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ echo "add patch-package"
55yarn add $1
66
77echo " edit a file"
8- replace exports patchPackage node_modules/lodash/_baseClamp.js
8+ npx replace exports patchPackage node_modules/lodash/_baseClamp.js
99
1010echo " add a file"
1111echo " this is a new file" > node_modules/lodash/newFile.md
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ grep patch-package node_modules/@types/left-pad/index.d.ts
99echo " END SNAPSHOT"
1010
1111echo " modify add.d.t.s"
12- replace add patch-package node_modules/@types/lodash/add.d.ts
12+ npx replace add patch-package node_modules/@types/lodash/add.d.ts
1313
1414echo " patch-package can make patches for scoped packages"
1515npx patch-package @types/lodash
1616
1717echo " remove node_modules"
18- rimraf node_modules
18+ npx rimraf node_modules
1919
2020echo " reinstall node_modules"
2121yarn
Original file line number Diff line number Diff line change 44echo " add patch-package"
55npm i $1
66
7- rimraf node_modules
7+ npx rimraf node_modules
88
99npm i
1010
You canβt perform that action at this time.
0 commit comments