cloudron 8.0.0 → 8.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
@@ -91,7 +91,7 @@ const buildCommand = program.command('build').description('Build using the build
91
91
  .option('--build-service-url <url>', 'Build service URL')
92
92
  .option('--build-service-token <token>', 'Build service token');
93
93
 
94
- buildCommand.command('build', { isDefault: true })
94
+ const buildBuildCommand = buildCommand.command('build', { isDefault: true })
95
95
  .description('Build an app')
96
96
  .option('--build-arg <namevalue>', 'Build arg passed to docker. Can be used multiple times', collectBuildArgs, [])
97
97
  .option('-f, --file <dockerfile>', 'Name of the Dockerfile')
@@ -137,6 +137,11 @@ buildCommand.command('status')
137
137
  .option('--id <buildid>', 'Build ID')
138
138
  .action(buildActions.status);
139
139
 
140
+ buildCommand.addHelpText('after', (ctx) => {
141
+ const header = '\nDefault subcommand `build` (same as `cloudron build build`; used when no subcommand is given):\n\n';
142
+ return header + buildBuildCommand.helpInformation({ error: ctx.error });
143
+ });
144
+
140
145
  backupCommand.command('create')
141
146
  .description('Create new app backup')
142
147
  .option('--site <siteid>', 'App id')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "type": "module",
package/src/actions.js CHANGED
@@ -347,6 +347,7 @@ async function login(adminFqdn, localOptions, cmd) {
347
347
 
348
348
  if (semver.gte(response.body.version, '9.1.0')) {
349
349
  token = await performOidcLogin(adminFqdn, { rejectUnauthorized });
350
+ if (!token) process.exit(1);
350
351
  } else {
351
352
  const username = options.username || await readline.question('Username: ', {});
352
353
  const password = options.password || await readline.question('Password: ', { noEchoBack: true });
package/src/helper.js CHANGED
@@ -87,7 +87,7 @@ async function performOidcLogin(adminFqdn, { rejectUnauthorized = true } = {}) {
87
87
 
88
88
  const { device_code, user_code, verification_uri_complete, verification_uri, interval: pollInterval = 5 } = deviceResponse.body;
89
89
 
90
- console.log(`\nOpen ${verification_uri_complete || verification_uri} in a browser and enter code: ${user_code}\n`);
90
+ console.log(`\nOpen ${verification_uri_complete || verification_uri} in a browser and confirm code: ${user_code}\n`);
91
91
 
92
92
  // try to open browser automatically
93
93
  safe(open(verification_uri_complete || verification_uri));
@@ -119,10 +119,12 @@ async function performOidcLogin(adminFqdn, { rejectUnauthorized = true } = {}) {
119
119
  continue;
120
120
  }
121
121
 
122
- throw new Error(tokenResponse.body.error_description || error);
122
+ console.log('Login failed. Try again.');
123
+ return null;
123
124
  }
124
125
 
125
- throw new Error('Login timed out');
126
+ console.log('Login timed out. Try again.');
127
+ return null;
126
128
  }
127
129
 
128
130
  export {