@toa.io/cli 0.1.1-dev.2 → 0.2.0-dev.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/cli",
3
- "version": "0.1.1-dev.2",
3
+ "version": "0.2.0-dev.2",
4
4
  "description": "Toa CLI",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -11,10 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/toa-io/toa/issues"
13
13
  },
14
- "main": "package.json",
15
- "bin": {
16
- "toa": "bin/toa"
17
- },
14
+ "main": "src/program.js",
18
15
  "publishConfig": {
19
16
  "access": "public"
20
17
  },
@@ -25,5 +22,5 @@
25
22
  "find-up": "5.0.0",
26
23
  "yargs": "17.2.1"
27
24
  },
28
- "gitHead": "76c1dfccbe68b25e272be0a20a79a84a61e7b4c3"
25
+ "gitHead": "83480176c88640dd2bed2a775ce2d13b95341f19"
29
26
  }
@@ -9,6 +9,9 @@ const builder = (yargs) => {
9
9
  desc: 'Path to context',
10
10
  default: '.'
11
11
  })
12
+ .option('no-wait', {
13
+ boolean: true
14
+ })
12
15
  .usage('Usage: toa deploy /path/to/context')
13
16
  .commandDir('./deploy')
14
17
  }
@@ -5,10 +5,12 @@ const boot = require('@toa.io/boot')
5
5
  const { context: find } = require('../util/find')
6
6
 
7
7
  const deploy = async (argv) => {
8
- const context = find(argv.path)
9
- const deployment = await boot.deployment(context)
8
+ const path = find(argv.path)
9
+ const deployment = await boot.deployment(path)
10
+ const images = await boot.images(path)
10
11
 
11
- await deployment.install()
12
+ await images.push()
13
+ await deployment.install(argv['no-wait'] !== true)
12
14
  }
13
15
 
14
16
  exports.deploy = deploy
package/src/program.js CHANGED
@@ -6,19 +6,18 @@ const { console } = require('@toa.io/gears')
6
6
  const { version } = require('../package.json')
7
7
 
8
8
  yargs(process.argv.slice(2))
9
+ .parserConfiguration({
10
+ 'boolean-negation': false
11
+ })
9
12
  .middleware((argv) => {
10
- if (argv.log === undefined) {
11
- if (process.env.TOA_ENV === 'dev') argv.log = 'info'
12
- else argv.log = 'warn'
13
- }
13
+ if (argv.log === undefined) argv.log = 'info'
14
14
 
15
15
  console.level(argv.log)
16
16
  })
17
17
  .fail((msg, err) => {
18
18
  const actual = err || new Error(msg)
19
19
 
20
- if (process.env.TOA_ENV === 'dev') console.log(actual)
21
- else console.error(actual.message)
20
+ console.error(actual)
22
21
 
23
22
  process.exit(actual.exitCode > 0 ? actual.exitCode : 1)
24
23
  })
package/bin/toa DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict'
3
-
4
- require('../src/program')