• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / boxcli / 5794698568

pending completion
5794698568

Pull #488

github

web-flow
Merge 96c25857d into 3bc6a83f7
Pull Request #488: docs: Update docs after release 3.9.2

1113 of 1441 branches covered (77.24%)

Branch coverage included in aggregate %.

4135 of 4633 relevant lines covered (89.25%)

468.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.17
/src/commands/configure/environments/get.js
1
'use strict';
2

3
const BoxCommand = require('../../../box-command');
12✔
4
const { flags } = require('@oclif/command');
12✔
5
const _ = require('lodash');
12✔
6

7
class EnvironmentsGetCommand extends BoxCommand {
8
        async run() {
9
                const { flags, args } = this.parse(EnvironmentsGetCommand);
×
10
                let environmentsObj = await this.getEnvironments();
×
11
                let environment;
12

13
                if (flags.current) {
×
14
                        let currentEnv = environmentsObj.default;
×
15
                        environment = environmentsObj.environments[currentEnv];
×
16
                } else if (flags.name) {
×
17
                        environment = environmentsObj.environments[flags.name];
×
18
                } else {
19
                        environment = environmentsObj.environments;
×
20
                }
21

22
                if (_.isEmpty(environment)) {
×
23
                        this.error('No environment(s) exists');
×
24
                } else {
25
                        await this.output(environment);
×
26
                }
27
        }
28
}
29

30
// @NOTE: This command does not require a client to be set up
31
EnvironmentsGetCommand.noClient = true;
12✔
32

33
EnvironmentsGetCommand.description = 'Get a Box environment';
12✔
34

35
EnvironmentsGetCommand.flags = {
12✔
36
        ...BoxCommand.minFlags,
37
        current: flags.boolean({
38
                char: 'c',
39
                description: 'Get the current default Box environment',
40
                exclusive: ['name']
41
        }),
42
        name: flags.string({
43
                char: 'n',
44
                description: 'Get a Box environment with this name',
45
                exclusive: ['current']
46
        })
47
};
48

49
module.exports = EnvironmentsGetCommand;
12✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc