env
This file
Path
examples/env
23 lines · 443 bytes
Last changed by
Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
History of this fileTake it
The walk stopped after 200 commits: lines older than b2aad7a point at it.
Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a
lines 1–4why, one step back1#!/usr/bin/env node23var program = require('../');4Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 5–7why, one step back5let cmdValue;6let envValue;7Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a
lines 8–10why, one step back8program9 .version('0.0.1')10 .arguments('<cmd> [env]')Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 11–13why, one step back11 .action(function(cmd, env) {12 cmdValue = cmd;13 envValue = env;Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a
lines 14–18why, one step back14 });1516program.parse(process.argv);1718if (typeof cmdValue === 'undefined') {Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
lines 19–20why, one step back19 console.error('no command given!');20 process.exit(1);Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a
lines 21–22why, one step back21}22console.log('command:', cmdValue);Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98
line 23why, one step back23console.log('environment:', envValue || 'no environment given');