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

box / boxcli / 10810816048

11 Sep 2024 11:36AM UTC coverage: 86.569% (-0.05%) from 86.616%
10810816048

Pull #542

github

web-flow
Merge a647aad97 into 0ed1618f5
Pull Request #542: docs: Add examples to file/folder metadata commands

1191 of 1536 branches covered (77.54%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

4281 of 4785 relevant lines covered (89.47%)

310.32 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');
8✔
4
const { flags } = require('@oclif/command');
8✔
5
const _ = require('lodash');
8✔
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;
8✔
32

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

35
EnvironmentsGetCommand.flags = {
8✔
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;
8✔
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