From 2bf23ba407a594ac8ee7e693ec93b17dd906f926 Mon Sep 17 00:00:00 2001 From: Contra Date: Tue, 17 Jun 2014 18:25:58 -0700 Subject: [PATCH] add INIT_CWD env var from CLI, closes #524. 3.8.1 --- CHANGELOG.md | 4 ++++ bin/gulp.js | 4 ++++ docs/CLI.md | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 288470418..0d883db22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # gulp changelog +# 3.8.1 + +- the CLI now adds process.env.INIT_CWD which is the original cwd it was launched from + # 3.8.0 - update vinyl-fs diff --git a/bin/gulp.js b/bin/gulp.js index f3f8494c1..52d9f70fa 100755 --- a/bin/gulp.js +++ b/bin/gulp.js @@ -13,6 +13,10 @@ var completion = require('../lib/completion'); var argv = require('minimist')(process.argv.slice(2)); var taskTree = require('../lib/taskTree'); +// set env var for ORIGINAL cwd +// before anything touches it +process.env.INIT_CWD = process.cwd(); + var cli = new Liftoff({ name: 'gulp', completions: completion, diff --git a/docs/CLI.md b/docs/CLI.md index 52ab23bae..7fc957024 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -13,10 +13,12 @@ gulp has very few flags to know about. All other flags are for tasks to use if n - `--color` will force gulp and gulp plugins to display colors even when no color support is detected - `--no-color` will force gulp and gulp plugins to not display colors even when color support is detected +The CLI adds process.env.INIT_CWD which is the original cwd it was launched from + ### Tasks Tasks can be executed by running `gulp `. Just running `gulp` will execute the task you registered called `default`. If there is no `default` task gulp will error. ### Compilers -You can find a list of supported languages at [interpret](https://github.com/tkellen/node-interpret#jsvariants). If you would like to add support for a new language send pull request/open issues there. \ No newline at end of file +You can find a list of supported languages at [interpret](https://github.com/tkellen/node-interpret#jsvariants). If you would like to add support for a new language send pull request/open issues there.