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

box / boxcli / 3688883245

pending completion
3688883245

Pull #441

github

GitHub
Merge 0c6f2cfe0 into 83ac6d7c8
Pull Request #441: fix: single file upload on Node 16

1077 of 1387 branches covered (77.65%)

Branch coverage included in aggregate %.

35 of 54 new or added lines in 9 files covered. (64.81%)

1 existing line in 1 file now uncovered.

3935 of 4421 relevant lines covered (89.01%)

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

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

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