Skip to content
Myr

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 file

Take 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 back
1#!/usr/bin/env node
23var program = require('../');4

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

lines 5–7why, one step back
5let cmdValue;
6let envValue;7

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 8–10why, one step back
8program
9 .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 back
11 .action(function(cmd, env) {
12 cmdValue = cmd;13 envValue = env;

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 14–18why, one step back
14 });
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 back
19 console.error('no command given!');
20 process.exit(1);

Merge pull request #453 from zhiyelee/masterZhiye Libefore adoptionb2aad7a

lines 21–22why, one step back
21}
22console.log('command:', cmdValue);

Examples: use "require" that works from git repo, and lint. (#1072)John Geebefore adoption57e9d98

line 23why, one step back
23console.log('environment:', envValue || 'no environment given');