Commit 0db1205
authored
fix(cli): fix project resolution in env vars subcommands and services env response (#59)
* fix(cli): fix project resolution in env vars subcommands and services env response parsing
Two bugs fixed:
1. `environments vars` subcommands (get, set, delete, import, export) used
`cmd.parent!.parent!.opts().project` to read the `--project` flag, traversing
one level too high in the command hierarchy. The `--project` flag is defined on
the `vars` command, so the correct traversal is `cmd.parent!.opts().project`.
The `list` subcommand already did this correctly.
Before: `temps envs vars -p my-app delete KEY` → "Project undefined not found"
After: `temps envs vars -p my-app delete KEY` → successfully deletes
2. `services env` command crashed with "envVars is not iterable" because the API
endpoint returns `HashMap<String, String>` (a plain object) but the CLI expected
`Array<EnvironmentVariableInfo>`. Added handling to convert the object response
into the expected array format.
Before: `temps services env --id 1 -p my-app` → "envVars is not iterable"
After: `temps services env --id 1 -p my-app` → displays variables correctly
* docs: add CLI env vars fixes to changelog [Unreleased]1 parent 2ca89d2 commit 0db1205
File tree
3 files changed
+16
-5
lines changed- apps/temps-cli/src/commands
- environments
- services
3 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1076 | 1085 | | |
1077 | 1086 | | |
1078 | 1087 | | |
| |||
0 commit comments