cloudron 4.12.10 → 4.13.0-1

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/cloudron CHANGED
@@ -3,14 +3,15 @@
3
3
  'use strict';
4
4
 
5
5
  require('supererror');
6
- require('colors');
7
6
 
8
7
  const actions = require('../src/actions.js'),
9
8
  buildActions = require('../src/build-actions.js'),
10
9
  completion = require('../src/completion.js'),
11
10
  config = require('../src/config.js'),
12
11
  program = require('commander'),
12
+ safe = require('safetydance'),
13
13
  semver = require('semver'),
14
+ superagent = require('superagent'),
14
15
  util = require('util');
15
16
 
16
17
  const version = require('../package.json').version;
@@ -21,19 +22,6 @@ if (!semver.satisfies(process.version, require('../package.json').engines.node))
21
22
  process.exit(1);
22
23
  }
23
24
 
24
- // completion is useful in shell configs, so don't block here
25
- if (process.argv[2] !== 'completion') {
26
- if (Date.now() - (config.get('lastCliUpdateCheck') || 0) > 24*60*60*1000) {
27
- // check if cli tool is up-to-date
28
- var res = require('superagent-sync').get('https://registry.npmjs.org/cloudron').retry(0).end();
29
- if (res.statusCode === 200 && res.body['dist-tags'].latest !== version) {
30
- var updateCommand = 'npm install -g cloudron@' + res.body['dist-tags'].latest;
31
- process.stderr.write(util.format('A new version of Cloudron CLI is available. Please update with: %s\n'.yellow.bold, updateCommand.white));
32
- }
33
- config.set('lastCliUpdateCheck', Date.now());
34
- }
35
- }
36
-
37
25
  function collectArgs(value, collected) {
38
26
  collected.push(value);
39
27
  return collected;
@@ -87,13 +75,6 @@ program.command('configure')
87
75
  .option('-l, --location <location>', 'Location')
88
76
  .action(actions.configure);
89
77
 
90
- program.command('createOAuthAppCredentials')
91
- .option('--redirect-uri [uri]', 'Redirect Uri', 'http://localhost:4000')
92
- .option('--scope [scopes]', 'Scopes (comma separated)', 'apps,appstore,clients,cloudron,domains,mail,profile,settings,subscription,users')
93
- .option('--shell', 'Print shell friendly output')
94
- .description('Create oauth app credentials for local development')
95
- .action(actions.createOAuthAppCredentials);
96
-
97
78
  program.command('debug [cmd...]')
98
79
  .description('Put app in debug mode and run [cmd] as entrypoint. If cmd is "default" the main app entrypoint is run.')
99
80
  .option('--app <id/location>', 'App id or location')
@@ -145,7 +126,6 @@ program.command('init')
145
126
 
146
127
  program.command('install')
147
128
  .description('Install or update app')
148
- .option('--app <id/location>', 'App id or location. OBSOLETE: Use "update" instead.')
149
129
  .option('--image <docker image>', 'Docker image')
150
130
  .option('--no-wait', 'Wait for healthcheck to succeed [false]', false)
151
131
  .option('-p, --port-bindings [PORT=port,...]', 'Query port bindings')
@@ -257,11 +237,26 @@ program.command('update')
257
237
  .option('--no-force', 'Match appstore id and manifest id before updating', true)
258
238
  .action(actions.update);
259
239
 
260
- // deal first with global flags!
261
- program.parse(process.argv);
240
+ (async function main() {
241
+ // completion is useful in shell configs, so don't block here
242
+ if (process.argv[2] !== 'completion') {
243
+ if (Date.now() - (config.get('lastCliUpdateCheck') || 0) > 24*60*60*1000) {
244
+ // check if cli tool is up-to-date
245
+ const [error, response] = await safe(superagent.get('https://registry.npmjs.org/cloudron').retry(0).ok(() => true));
246
+ if (!error && response.statusCode === 200 && response.body['dist-tags'].latest !== version) {
247
+ const updateCommand = 'npm install -g cloudron@' + response.body['dist-tags'].latest;
248
+ process.stderr.write(util.format('A new version of Cloudron CLI is available. Please update with: %s\n', updateCommand));
249
+ }
250
+ config.set('lastCliUpdateCheck', Date.now());
251
+ }
252
+ }
253
+
254
+ program.parse(process.argv);
255
+
256
+ const knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
257
+ if (!knownCommand) {
258
+ console.log('Unknown command: ' + process.argv[2].bold + '.\nTry ' + 'cloudron help'.yellow);
259
+ process.exit(1);
260
+ }
261
+ })();
262
262
 
263
- var knownCommand = program.commands.some(function (command) { return command._name === process.argv[2] || command._alias === process.argv[2]; });
264
- if (!knownCommand) {
265
- console.log('Unknown command: ' + process.argv[2].bold + '.\nTry ' + 'cloudron help'.yellow);
266
- process.exit(1);
267
- }
@@ -3,7 +3,6 @@
3
3
  'use strict';
4
4
 
5
5
  require('supererror');
6
- require('colors');
7
6
 
8
7
  var program = require('commander'),
9
8
  appstoreActions = require('../src/appstore-actions.js');
@@ -3,7 +3,6 @@
3
3
  'use strict';
4
4
 
5
5
  require('supererror');
6
- require('colors');
7
6
 
8
7
  var program = require('commander'),
9
8
  actions = require('../src/actions.js'),
package/bin/cloudron-env CHANGED
@@ -3,7 +3,6 @@
3
3
  'use strict';
4
4
 
5
5
  require('supererror');
6
- require('colors');
7
6
 
8
7
  var program = require('commander'),
9
8
  actions = require('../src/actions.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "4.12.10",
3
+ "version": "4.13.0-1",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "main": "main.js",
@@ -17,26 +17,23 @@
17
17
  },
18
18
  "author": "Cloudron Developers <support@cloudron.io>",
19
19
  "dependencies": {
20
- "async": "^3.2.2",
20
+ "async": "^3.2.3",
21
21
  "cloudron-manifestformat": "^5.14.0",
22
- "colors": "1.4.0",
23
22
  "commander": "^6.1.0",
24
23
  "debug": "^4.3.3",
24
+ "delay": "^5.0.0",
25
25
  "easy-table": "^1.2.0",
26
26
  "ejs": "^3.1.6",
27
27
  "eventsource": "^1.1.0",
28
28
  "micromatch": "^4.0.4",
29
- "mkdirp": "^1.0.4",
30
29
  "once": "^1.4.0",
31
30
  "open": "^8.4.0",
32
31
  "progress": "^2.0.3",
33
32
  "progress-stream": "^2.0.0",
34
33
  "readline-sync": "^1.4.10",
35
- "request": "^2.88.2",
36
34
  "safetydance": "^2.2.0",
37
35
  "split": "^1.0.1",
38
- "superagent": "^6.1.0",
39
- "superagent-sync": "^0.2.1",
36
+ "superagent": "^7.0.2",
40
37
  "supererror": "^0.7.2",
41
38
  "tar-fs": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.12.0.tgz",
42
39
  "underscore": "^1.13.2"