Skip to content

Commit

Permalink
Merge pull request #28 from rightscale/script_error_when_no_result_in…
Browse files Browse the repository at this point in the history
…_block

Error if a script block does not specify a result in fpt script
  • Loading branch information
douglaswth authored Dec 11, 2020
2 parents 2ffd9d0 + d7292da commit 2c2d2ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.14.x
- 1.15.x
matrix:
include:
- os: linux
Expand Down
4 changes: 4 additions & 0 deletions cmd/fpt/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.2.1 / 2020-12-10
-------------------
* Error if a `script` block does not specify a result in `fpt script`

v1.2.0 / 2020-10-21
-------------------
* Add support for Flexera One refresh tokens using an optional `flexera` boolean parameter in account entries in
Expand Down
3 changes: 3 additions & 0 deletions cmd/fpt/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func runScript(ctx context.Context, file, outfile, result, name string, options
strings.Join(names, " or "))
}
}
if result == "" {
return fmt.Errorf("no result variable specified in script block %#v", name)
}
} else if result == "" {
return fmt.Errorf("no result variable specified for raw JavaScript, pass --result with the name of the variable to extract")
} else {
Expand Down

0 comments on commit 2c2d2ff

Please sign in to comment.