File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -223,15 +223,20 @@ replace-in-file from to some/file.js,some/**/glob.js
223223
224224Multiple files or globs can be replaced by providing a comma separated list.
225225
226- The flags ` disableGlobs ` , ` ignore ` and ` encoding ` are supported in the CLI.
226+ The flags ` -- disableGlobs` , ` -- ignore` and ` -- encoding` are supported in the CLI.
227227
228- The flag ` allowEmptyPaths ` is not supported in the CLI as the replacement is
229- synchronous, and the flag is only relevant for asynchronous replacement.
228+ The setting ` allowEmptyPaths ` is not supported in the CLI as the replacement is
229+ synchronous, and this setting is only relevant for asynchronous replacement.
230230
231- To list the changed files, use the ` verbose ` flag.
231+ To list the changed files, use the ` -- verbose` flag.
232232
233233A regular expression may be used for the ` from ` parameter by specifying the ` --isRegex ` flag.
234234
235+ The ` from ` and ` to ` parameters, as well as the files list, can be omitted if you provide this
236+ information in a configuration file. You can provide a path to a configuration file
237+ (either Javascript or JSON) with the ` --configFile ` flag. This path will be resolved using
238+ Node’s built in ` path.resolve() ` , so you can pass in an absolute or relative path.
239+
235240## Version information
236241From version 3.0.0 onwards, replace in file requires Node 6 or higher. If you need support for Node 4 or 5, use version 2.x.x.
237242
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ module.exports = function loadConfig(file) {
1515 return { } ;
1616 }
1717
18- //Combine with CWD
19- file = path . join ( process . cwd ( ) , file ) ;
18+ //Resolve path
19+ file = path . resolve ( file ) ;
2020
2121 //Try to load
2222 return require ( file ) ;
You can’t perform that action at this time.
0 commit comments