heroku 10.0.3-alpha.3 → 10.0.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/run CHANGED
@@ -1,15 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const {Config} = require('@oclif/core')
4
- const root = require.resolve('../package.json')
5
- const config = new Config({root})
6
-
7
3
  process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'
8
4
 
9
5
  const now = new Date()
10
6
  const cliStartTime = now.getTime()
11
7
  const globalTelemetry = require('../lib/global_telemetry')
12
- const yargs = require('yargs-parser')(process.argv.slice(2))
13
8
 
14
9
  process.once('beforeExit', async code => {
15
10
  // capture as successful exit
@@ -43,34 +38,13 @@ process.on('SIGTERM', async () => {
43
38
  globalTelemetry.initializeInstrumentation()
44
39
 
45
40
  const oclif = require('@oclif/core')
46
- const oclifFlush = require('@oclif/core/flush')
47
- const oclifError = require('@oclif/core/handle')
48
- const { promptUser } = require('./heroku-prompts')
49
- const { herokuRepl } = require('./heroku-repl')
50
41
 
51
- const main = async () => {
52
- try {
53
- await config.load()
54
- const {_: [commandName, ...args], ...flags} = yargs
55
- if (!commandName && !args.length && !Object.keys(flags).length) {
56
- return await herokuRepl(config)
57
- }
58
- if (flags.prompt) {
59
- delete flags.prompt
60
- await promptUser(config, commandName, args, flags)
61
- await oclif.run([commandName, ...args], config)
62
- } else {
63
- await oclif.run(undefined, config)
64
- }
65
- await oclifFlush()
66
- } catch (error) {
67
- // capture any errors raised by oclif
68
- const cliError = error
69
- cliError.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
70
- await globalTelemetry.sendTelemetry(cliError)
42
+ oclif.run().then(require('@oclif/core/flush')).catch(async error => {
43
+ // capture any errors raised by oclif
44
+ const cliError = error
45
+ cliError.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
46
+ await globalTelemetry.sendTelemetry(cliError)
71
47
 
72
- oclifError(error)
73
- }
74
- };
48
+ return require('@oclif/core/handle')(error)
49
+ })
75
50
 
76
- void main();
package/lib/file.d.ts CHANGED
@@ -10,5 +10,5 @@ export declare function ls(dir: string): Promise<{
10
10
  }[]>;
11
11
  export declare function removeEmptyDirs(dir: string): Promise<void>;
12
12
  export declare function readJSON(file: string): Promise<any>;
13
- export declare function outputJSON(file: string, data: any, options?: FS.WriteOptions): Promise<void>;
13
+ export declare function outputJSON(file: string, data: any): Promise<void>;
14
14
  export declare function realpathSync(p: string): string;
package/lib/file.js CHANGED
@@ -53,9 +53,9 @@ async function readJSON(file) {
53
53
  return deps_1.default.fs.readJSON(file);
54
54
  }
55
55
  exports.readJSON = readJSON;
56
- async function outputJSON(file, data, options = {}) {
56
+ async function outputJSON(file, data) {
57
57
  debug('outputJSON', file);
58
- return deps_1.default.fs.outputJSON(file, data, Object.assign({ spaces: 2 }, options));
58
+ return deps_1.default.fs.outputJSON(file, data, { spaces: 2 });
59
59
  }
60
60
  exports.outputJSON = outputJSON;
61
61
  function realpathSync(p) {