Skip to content

Commit a377474

Browse files
committed
fix: adds env to parsed command json strings
1 parent 089794d commit a377474

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

cmd/run/completions/run.fish

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# args: (1)
12
# run fish shell completion
23
set PROGNAME run
34

45
# list_targets fetches all targets, with all flags provided on the cli
56
function list_targets
6-
eval $PROGNAME --list
7-
# eval (commandline -b) --list
7+
# eval $PROGNAME --list
8+
eval (commandline -b) --list
89
end
910

1011
complete -c $PROGNAME -d "runs named task" -xa '(list_targets)'

parser/parse-command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func parseCommand(ctx types.Context, prf *types.ParsedRunfile, taskEnv map[strin
1616
switch c := command.(type) {
1717
case string:
1818
{
19-
return &types.ParsedCommandJson{Command: &c}, nil
19+
return &types.ParsedCommandJson{Command: &c, Env: taskEnv}, nil
2020
}
2121
case map[string]any:
2222
{

parser/parse-command_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ func Test_parseCommand(t *testing.T) {
7575
prf: &types.ParsedRunfile{
7676
Tasks: map[string]types.Task{
7777
"build": {
78+
Env: types.EnvVar{
79+
"k1": map[string]any{
80+
"required": true,
81+
},
82+
},
7883
Commands: []any{
7984
"echo from build",
8085
},

runner/run-task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func printCommand(writer io.Writer, prefix, lang, cmd string) {
9191
// choose colorschemes from `https://swapoff.org/chroma/playground/`
9292
colorscheme := "catppuccin-macchiato"
9393
if !isDarkTheme() {
94-
colorscheme = "monokailight"
94+
colorscheme = "xcode"
9595
}
9696
_ = colorscheme
9797

0 commit comments

Comments
 (0)