Skip to content

Commit 072d796

Browse files
authored
Merge pull request #296 from lets-cli/feature/dependency-failure-tree
Show dependency failure tree when command chain fails
2 parents 7e0d935 + bb3d7e4 commit 072d796

12 files changed

Lines changed: 977 additions & 30 deletions

cmd/lets/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/lets-cli/lets/internal/cmd"
1212
"github.com/lets-cli/lets/internal/config"
1313
"github.com/lets-cli/lets/internal/env"
14+
"github.com/lets-cli/lets/internal/executor"
1415
"github.com/lets-cli/lets/internal/logging"
1516
"github.com/lets-cli/lets/internal/set"
1617
"github.com/lets-cli/lets/internal/upgrade"
@@ -119,6 +120,10 @@ func main() {
119120
}
120121

121122
if err := rootCmd.ExecuteContext(ctx); err != nil {
123+
var depErr *executor.DependencyError
124+
if errors.As(err, &depErr) {
125+
executor.PrintDependencyTree(depErr, os.Stderr)
126+
}
122127
log.Error(err.Error())
123128
os.Exit(getExitCode(err, 1))
124129
}

docs/docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: Changelog
99
* `[Changed]` Exit code 2 on unknown command.
1010
* `[Added]` Expose `LETS_OS` and `LETS_ARCH` environment variables at command runtime.
1111
* `[Removed]` Drop deprecated `eval_env` directive. Use `env` with `sh` execution mode instead.
12-
* `[Fixed]` Evaluate `env` entries sequentially so `sh` values can reference previously resolved env keys (including global env for command-level env).
12+
* `[Added]` When a command or its `depends` chain fails, print an indented tree to stderr showing the full chain with the failing command highlighted
1313

1414
## [0.0.59](https://github.com/lets-cli/lets/releases/tag/v0.0.59)
1515

0 commit comments

Comments
 (0)