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

yext / jambo / 8102725903

29 Feb 2024 09:17PM UTC coverage: 47.814%. Remained the same
8102725903

push

github

web-flow
Version 1.12.5 (#333)

### Fixes
- Addressed various vulnerabilities from our dependencies (#330, #332)

236 of 511 branches covered (46.18%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

770 of 1593 relevant lines covered (48.34%)

6.58 hits per line

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

0.0
/src/utils/customcommands/commandexecuter.js
1
const path = require('path');
×
2
const { spawnSync } = require('child_process');
×
3
const SystemError = require('../../errors/systemerror');
×
4

5
/**
6
 * This class is responsible for executing a {@link CustomCommand}.
7
 * It makes the various Jambo directories available to the command as
8
 * flags.
9
 */
10
exports.CustomCommandExecuter = class {
×
11
    constructor(jamboConfig) {
12
        this._jamboFlags = this._generateJamboFlags(jamboConfig);
×
13
    }
14

15
    /**
16
     * Executes the provided {@link CustomCommand}. The result of the execution
17
     * is returned.
18
     *
19
     * @param {CustomCommand} command The command to execute in the shell.
20
     * @returns {Object} The result of executing the {@link CustomCommand}. This
21
     *                   object contains stdout, stderr, a status code, and an
22
     *                   error if the child process failed.
23
     */
24
    execute(command) {
25
        command.addArgs(this._jamboFlags);
×
26
        return spawnSync(
×
27
            command.getExecutable(),
28
            command.getArgs(),
29
            {
30
                cwd: command.getCwd(),
31
                shell: true,
32
                stdio: 'inherit'
33
            }
34
        );
35
    }
36

37
    /**
38
     * Makes command line flags for all of the properties in the given jambo config.
39
     *
40
     * @param {Object} jamboConfig The Jambo config object.
41
     * @returns {Array} An array containing the flags to add to any {@link CustomCommand}.
42
     */
43
    _generateJamboFlags(jamboConfig) {
44
        const jamboFlags = [];
×
45
        const prefix = '--jambo';
×
46
        const getAbsolutePath = jamboDir => {
×
NEW
47
            return path.isAbsolute(jamboDir) ?
×
48
                jamboDir :
49
                path.join(process.cwd(), jamboDir);
50
        }
51
        Object.entries(jamboConfig.dirs).forEach(([name, value]) => {
×
NEW
52
            jamboFlags.push([prefix, 'dirs', name].join('.'));
×
53
            if (Array.isArray(value)) {
×
54
                jamboFlags.push(value.map(dirpath => getAbsolutePath(dirpath)));
×
55
            } else {
56
                jamboFlags.push(getAbsolutePath(value));
×
57
            }
58
        });
59
        if (jamboConfig.defaultTheme) {
×
60
            jamboFlags.push([prefix, 'defaultTheme'].join('.'));
×
61
            jamboFlags.push(jamboConfig.defaultTheme);
×
62
        }
63

64
        return jamboFlags;
×
65
    }
66
}
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

© 2026 Coveralls, Inc