-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: will now work even if "AWS_CLI_AUTO_PROMPT=on" is set in the cur…
…rent shell (#2) feat: added init project command for python and typescript cdk projects chore: upgraded dependencies chore: set version 2.5.9
- Loading branch information
1 parent
ba0db97
commit 266f702
Showing
7 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/se/attini/cli/init/InitCdkPythonCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
package se.attini.cli.init; | ||
|
||
|
||
import static java.util.Objects.requireNonNull; | ||
import static se.attini.cli.PrintItem.PrintType.SUCCESS; | ||
|
||
import jakarta.inject.Inject; | ||
import picocli.CommandLine; | ||
import se.attini.cli.AttiniCliCommand; | ||
import se.attini.cli.CliError; | ||
import se.attini.cli.ConsolePrinter; | ||
import se.attini.cli.ErrorResolver; | ||
import se.attini.cli.PrintItem; | ||
import se.attini.cli.global.DebugOption; | ||
import se.attini.init.InitProjectService; | ||
|
||
@CommandLine.Command(name = "cdk-python", versionProvider = AttiniCliCommand.VersionProvider.class, description = "Create a Python CDK project.") | ||
public class InitCdkPythonCommand implements Runnable { | ||
|
||
@CommandLine.Mixin | ||
private DebugOption debugOption; | ||
@SuppressWarnings("unused") | ||
@CommandLine.Option(names = {"--help", "-h"}, description = "Show information about this command.", usageHelp = true) | ||
private boolean help; | ||
private final ConsolePrinter consolePrinter; | ||
|
||
@Inject | ||
public InitCdkPythonCommand(ConsolePrinter consolePrinter) { | ||
this.consolePrinter = requireNonNull(consolePrinter, "consolePrinter"); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
try { | ||
InitProjectService.initCdkPythons(); | ||
consolePrinter.print(PrintItem.message(SUCCESS, | ||
"Successfully initialized Python CDK project")); | ||
} catch (Exception e) { | ||
CliError error = ErrorResolver.resolve(e); | ||
consolePrinter.printError(error); | ||
System.exit(error.getErrorCode().getExitCode()); | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/se/attini/cli/init/InitCdkTypeScriptCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
package se.attini.cli.init; | ||
|
||
|
||
import static java.util.Objects.requireNonNull; | ||
import static se.attini.cli.PrintItem.PrintType.SUCCESS; | ||
|
||
import jakarta.inject.Inject; | ||
import picocli.CommandLine; | ||
import se.attini.cli.AttiniCliCommand; | ||
import se.attini.cli.CliError; | ||
import se.attini.cli.ConsolePrinter; | ||
import se.attini.cli.ErrorResolver; | ||
import se.attini.cli.PrintItem; | ||
import se.attini.cli.global.DebugOption; | ||
import se.attini.init.InitProjectService; | ||
|
||
@CommandLine.Command(name = "cdk-typescript", versionProvider = AttiniCliCommand.VersionProvider.class, description = "Create a TypeScript CDK project.") | ||
public class InitCdkTypeScriptCommand implements Runnable { | ||
|
||
@CommandLine.Mixin | ||
private DebugOption debugOption; | ||
@SuppressWarnings("unused") | ||
@CommandLine.Option(names = {"--help", "-h"}, description = "Show information about this command.", usageHelp = true) | ||
private boolean help; | ||
private final ConsolePrinter consolePrinter; | ||
|
||
@Inject | ||
public InitCdkTypeScriptCommand(ConsolePrinter consolePrinter) { | ||
this.consolePrinter = requireNonNull(consolePrinter, "consolePrinter"); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
try { | ||
InitProjectService.initCdkTypeScript(); | ||
consolePrinter.print(PrintItem.message(SUCCESS, | ||
"Successfully initialized TypeScript CDK project")); | ||
} catch (Exception e) { | ||
CliError error = ErrorResolver.resolve(e); | ||
consolePrinter.printError(error); | ||
System.exit(error.getErrorCode().getExitCode()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters