Skip to content

Commit

Permalink
feat: add workingDir expression to access the current working directo…
Browse files Browse the repository at this point in the history
…ry (#5906)
  • Loading branch information
rangoo94 authored Oct 8, 2024
1 parent 962e206 commit a7af899
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/expressions/libs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func NewFsMachine(fsys fs.FS, workingDir string) expressions.Machine {
workingDir = "/"
}
return expressions.NewMachine().
Register("workingDir", workingDir).
RegisterFunction("file", func(values ...expressions.StaticValue) (interface{}, bool, error) {
v, err := readFile(fsys, workingDir, values...)
return v, true, err
Expand Down

0 comments on commit a7af899

Please sign in to comment.