Skip to content

Commit

Permalink
Merge pull request #29 from rightscale/fix_script_parameter_parsing
Browse files Browse the repository at this point in the history
Fix fpt script parameter parsing
  • Loading branch information
douglaswth authored Jan 15, 2021
2 parents 2c2d2ff + dd791ed commit 756b1e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/fpt/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.2.2 / 2021-01-15
-------------------
* Fix a bug in `fpt script` parameter parsing where non-numeric bare parameters came through as `nil` and numeric
parameters were not actually parsed and just came through as strings

v1.2.1 / 2020-12-10
-------------------
* Error if a `script` block does not specify a result in `fpt script`
Expand Down
2 changes: 1 addition & 1 deletion cmd/fpt/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func parseVal(name, v string) (interface{}, error) {
return nil, errors.Wrapf(err, "parameter %s: failed to parse %q as json", name, v)
}
return valJson, nil
} else if valN, err := coerceOption("", v, "number"); err != nil {
} else if valN, err := coerceOption(name, v, "number"); err == nil {
return valN, nil
}
return v, nil
Expand Down

0 comments on commit 756b1e0

Please sign in to comment.