createOrSelectStack static method

Future<Stack> createOrSelectStack(
  1. LocalProgramArgs args, {
  2. LocalWorkspaceOptions options = const LocalWorkspaceOptions(),
})

Creates the stack when missing, otherwise selects the existing stack.

Implementation

static Future<Stack> createOrSelectStack(
  LocalProgramArgs args, {
  LocalWorkspaceOptions options = const LocalWorkspaceOptions(),
}) async {
  final workspace = await create(options.copyWith(workDir: args.workDir));
  return Stack.createOrSelect(args.stackName, workspace);
}