File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -147,3 +147,14 @@ Functionally, this means:
147
147
hook scripts, then they can override the default package script with an
148
148
explicit ` cmd ` option pointing to the ` node_modules/.hook/${event} `
149
149
script.
150
+
151
+ ## Escaping
152
+
153
+ In order to ensure that arguments are handled consistently, this module
154
+ writes a temporary script file containing the command as it exists in
155
+ the package.json, followed by the user supplied arguments having been
156
+ escaped to ensure they are processed as literal strings. We then instruct
157
+ the shell to execute the script file, and when the process exits we remove
158
+ the temporary file.
159
+
160
+ The actual implementation of the escaping is in ` lib/escape.js ` .
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
+ // eslint-disable-next-line max-len
4
+ // this code adapted from: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
3
5
const cmd = ( input ) => {
4
6
if ( ! input . length ) {
5
7
return '""'
You can’t perform that action at this time.
0 commit comments