mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(env) UPPER_CASE first, and then lower_case (#283)
This commit is contained in:
parent
511e40fa72
commit
24ab06c005
2 changed files with 19 additions and 1 deletions
|
|
@ -18,6 +18,6 @@ function parse(name) {
|
|||
const small = `cloudcmd_${name}`;
|
||||
const big = up(small);
|
||||
|
||||
return env[small] || env[big];
|
||||
return env[big] || env[small];
|
||||
}
|
||||
|
||||
|
|
|
|||
18
server/env.spec.js
Normal file
18
server/env.spec.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
const test = require('supertape');
|
||||
const env = require('./env');
|
||||
|
||||
test('cloudcmd: server: env: bool: upper case first', (t) => {
|
||||
const {CLOUDCMD_TERMINAL} = process.env;
|
||||
const {cloudcmd_terminal} = process.env;
|
||||
|
||||
process.env.cloudcmd_terminal = 'true';
|
||||
process.env.CLOUDCMD_TERMINAL = 'false';
|
||||
|
||||
const result = env.bool('terminal');
|
||||
|
||||
t.notOk(result);
|
||||
t.end();
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue