Skip to content

Commit 249d2a5

Browse files
author
serverpod_cloud
committed
feat: a80b507a8c0da0bbb592c555e98992c438788533
1 parent 7ef1b37 commit 249d2a5

2 files changed

Lines changed: 43 additions & 32 deletions

File tree

serverpod_cloud_cli/lib/command_runner/cloud_cli_command_runner.dart

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,40 @@ enum GlobalOption<V> implements OptionDefinition<V> {
299299
fromDefault: _getDefaultStorageDir,
300300
),
301301
),
302+
projectDir(
303+
DirOption(
304+
argName: 'project-dir',
305+
argAbbrev: 'd',
306+
envName: 'SERVERPOD_CLOUD_PROJECT_DIR',
307+
helpText: 'The path to the Serverpod Cloud project server directory.',
308+
// (no general default value since significant whether explicitly specified)
309+
mode: PathExistMode.mustExist,
310+
),
311+
),
312+
projectConfigFile(
313+
FileOption(
314+
argName: 'project-config-file',
315+
envName: 'SERVERPOD_CLOUD_PROJECT_CONFIG_FILE',
316+
fromCustom: _projectConfigFileFinder,
317+
helpText: 'The path to the Serverpod Cloud project configuration file.',
318+
),
319+
),
320+
projectConfigContent(
321+
StringOption(
322+
argName: 'project-config-content',
323+
envName: 'SERVERPOD_CLOUD_PROJECT_CONFIG_CONTENT',
324+
helpText: 'Override the scloud project configuration with a YAML string.',
325+
),
326+
),
327+
connectionTimeout(
328+
DurationOption(
329+
argName: 'connection-timeout',
330+
envName: 'SERVERPOD_CLOUD_CONNECTION_TIMEOUT',
331+
defaultsTo: Duration(seconds: 60),
332+
helpText: 'The timeout for the connection to the Serverpod Cloud API.',
333+
),
334+
),
335+
302336
// Developer options and flags
303337
apiServer(
304338
StringOption(
@@ -326,32 +360,6 @@ enum GlobalOption<V> implements OptionDefinition<V> {
326360
hide: true,
327361
defaultsTo: false,
328362
),
329-
),
330-
331-
projectDir(
332-
DirOption(
333-
argName: 'project-dir',
334-
argAbbrev: 'd',
335-
envName: 'SERVERPOD_CLOUD_PROJECT_DIR',
336-
helpText: 'The path to the Serverpod Cloud project server directory.',
337-
// (no general default value since significant whether explicitly specified)
338-
mode: PathExistMode.mustExist,
339-
),
340-
),
341-
projectConfigFile(
342-
FileOption(
343-
argName: 'project-config-file',
344-
envName: 'SERVERPOD_CLOUD_PROJECT_CONFIG_FILE',
345-
fromCustom: _projectConfigFileFinder,
346-
helpText: 'The path to the Serverpod Cloud project configuration file.',
347-
),
348-
),
349-
projectConfigContent(
350-
StringOption(
351-
argName: 'project-config-content',
352-
envName: 'SERVERPOD_CLOUD_PROJECT_CONFIG_CONTENT',
353-
helpText: 'Override the scloud project configuration with a YAML string.',
354-
),
355363
);
356364

357365
const GlobalOption(this.option);
@@ -393,16 +401,18 @@ class GlobalConfiguration extends Configuration<GlobalOption> {
393401

394402
Directory get scloudDir => value(GlobalOption.scloudDir);
395403

396-
String get apiServer => value(GlobalOption.apiServer);
397-
398-
String get consoleServer => value(GlobalOption.consoleServer);
399-
400-
bool get skipConfirmation => value(GlobalOption.skipConfirmation);
401-
402404
Directory? get projectDir => optionalValue(GlobalOption.projectDir);
403405

404406
File? get projectConfigFile => optionalValue(GlobalOption.projectConfigFile);
405407

406408
String? get projectConfigContent =>
407409
optionalValue(GlobalOption.projectConfigContent);
410+
411+
Duration get connectionTimeout => value(GlobalOption.connectionTimeout);
412+
413+
String get apiServer => value(GlobalOption.apiServer);
414+
415+
String get consoleServer => value(GlobalOption.consoleServer);
416+
417+
bool get skipConfirmation => value(GlobalOption.skipConfirmation);
408418
}

serverpod_cloud_cli/lib/command_runner/helpers/cloud_cli_service_provider.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class CloudCliServiceProvider {
6161
logger: _logger,
6262
localStoragePath: localStoragePath.path,
6363
),
64+
connectionTimeout: _globalConfiguration.connectionTimeout,
6465
);
6566
}
6667

0 commit comments

Comments
 (0)