File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as path from "path" ;
22import { existsSync } from "fs" ;
3+ import { fromJS } from "immutable" ;
34import * as utils from "../utils" ;
45import { explodeFilesArg } from "./cli-options" ;
56const _ = require ( "../lodash.custom" ) ;
@@ -51,10 +52,11 @@ export default function(opts) {
5152 * @returns {* }
5253 */
5354function preprocessFlags ( flags ) {
54- return [ stripUndefined , legacyFilesArgs ] . reduce (
55- ( flags , fn ) => fn . call ( null , flags ) ,
56- flags
57- ) ;
55+ return [
56+ stripUndefined ,
57+ legacyFilesArgs ,
58+ removeWatchBooleanWhenFalse
59+ ] . reduce ( ( flags , fn ) => fn . call ( null , flags ) , flags ) ;
5860}
5961
6062/**
@@ -87,3 +89,18 @@ function legacyFilesArgs(flags) {
8789 }
8890 return flags ;
8991}
92+
93+ /**
94+ * `watch` is a CLI boolean so should be removed if false to
95+ * allow config to set watch: true
96+ * @param flags
97+ * @returns {any }
98+ */
99+ function removeWatchBooleanWhenFalse ( flags ) {
100+ if ( flags . watch === false ) {
101+ return fromJS ( flags )
102+ . delete ( "watch" )
103+ . toJS ( ) ;
104+ }
105+ return flags ;
106+ }
You can’t perform that action at this time.
0 commit comments