How to use the load function from @oclif/config

Find comprehensive JavaScript @oclif/config.load code examples handpicked from public code repositorys.

20
21
22
23
24
25
26
27
28
  state: 'provisioned',
  provision_message: 'provision message'
}

beforeEach(async () => {
  config = await Config.load()
  cli.mockConsole()
  api = nock('https://api.heroku.com:443')
})
fork icon242
star icon826
watch icon108

+ 2 other calls in file

21
22
23
24
25
26
27
28
29
30
if (acPlugin) {
    cli_ux_1.default.action.start('Updating completions');
    let ac = yield acPlugin.findCommand('autocomplete:buildcache');
    if (ac)
        yield ac.run([], this.config);
    let config = Object.assign(yield config_1.load({ root: __dirname, devPlugins: false }), this.config);
    yield completions_1.AppCompletion.options({ config });
    yield completions_1.PipelineCompletion.options({ config });
    yield completions_1.SpaceCompletion.options({ config });
    yield completions_1.TeamCompletion.options({ config });
fork icon0
star icon0
watch icon0

1
2
3
4
5
6
7
8
9
10
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const Config = tslib_1.__importStar(require("@oclif/config"));
const analytics_1 = tslib_1.__importDefault(require("../../analytics"));
async function run() {
    const config = await Config.load({ root: __dirname });
    const analytics = new analytics_1.default(config);
    await analytics.submit();
}
run()
fork icon0
star icon0
watch icon0

21
22
23
24
25
26
27
28
29
30

// oclif originally included the following too ...
// this resulted in an uncovered line in the tests, and it appeared to never happen anyway
// seem like it would only
// ||  module.parent && module.parent.parent && module.parent.parent.filename
const config = await Config.load(opts || __dirname)

let subCommand = argv[0]

// 1. find the first flag ( note: there could be none ... )
fork icon0
star icon0
watch icon0