When you use the --emulate or --run command with an argument this has the effect of setting the build variable to the argument value (e.g. 'ios').
Unfortunately gulp-if treats a string condition as a glob pattern to match on the filename so any test of the form plugins.if(build, ...) regards the condition as false.
The fix is to change the line:
var build = args.build || args.emulate || args.run;
to:
var build = !!(args.build || args.emulate || args.run);
forcing build to a boolean and the rest of the script then runs as expected.
When you use the
--emulate
or--run
command with an argument this has the effect of setting thebuild
variable to the argument value (e.g. 'ios').Unfortunately gulp-if treats a string condition as a glob pattern to match on the filename so any test of the form
plugins.if(build, ...)
regards the condition as false.The fix is to change the line:
to:
forcing
build
to a boolean and the rest of the script then runs as expected.