xtra-cli 1.0.2 → 1.0.3
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.
|
@@ -14,6 +14,7 @@ exports.checkoutCommand = new commander_1.Command("checkout")
|
|
|
14
14
|
.description("Switch the active branch context")
|
|
15
15
|
.argument("[branchName]", "Branch name to switch to (optional - will show list if not provided)")
|
|
16
16
|
.option("-p, --project <projectId>", "Project ID")
|
|
17
|
+
.option("-e, --env <environment>", "Set the active environment (e.g. development, staging, production)")
|
|
17
18
|
.action(async (branchName, options) => {
|
|
18
19
|
let { project } = options;
|
|
19
20
|
// Try to get project from config if not provided
|
|
@@ -59,7 +60,13 @@ exports.checkoutCommand = new commander_1.Command("checkout")
|
|
|
59
60
|
// Save to config
|
|
60
61
|
(0, config_1.setConfig)("branch", selectedBranch);
|
|
61
62
|
(0, config_1.setConfig)("project", project);
|
|
62
|
-
|
|
63
|
+
if (options.env) {
|
|
64
|
+
(0, config_1.setConfig)("env", options.env);
|
|
65
|
+
}
|
|
66
|
+
console.log(chalk_1.default.green(`\u2714 Switched to branch '${selectedBranch}'`));
|
|
67
|
+
if (options.env) {
|
|
68
|
+
console.log(chalk_1.default.green(`\u2714 Environment set to '${options.env}'`));
|
|
69
|
+
}
|
|
63
70
|
}
|
|
64
71
|
catch (error) {
|
|
65
72
|
spinner.fail("Failed to fetch branches");
|