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

box / boxcli / 10108407370

26 Jul 2024 08:42AM UTC coverage: 86.432% (-0.1%) from 86.538%
10108407370

Pull #539

github

web-flow
Merge bb7055572 into 035fd7aaf
Pull Request #539: feat: Support AI APIs using Box Node SDK

1173 of 1519 branches covered (77.22%)

Branch coverage included in aggregate %.

61 of 69 new or added lines in 2 files covered. (88.41%)

12 existing lines in 1 file now uncovered.

4261 of 4768 relevant lines covered (89.37%)

310.24 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