Skip to content
Phillip Markert edited this page Jan 1, 2017 · 6 revisions

Making a script self-executable

This is not necessarily a hyperpotamus feature, but it is still a nice convenience if you are running on MacOS or any other *nix variant. You can use your shell functionality to make your scripts self-executable with the following steps:

  1. Add a shebang directive on the first line of your script #!/usr/bin/env hyperpotamus

  2. Mark your script as executable chmod +x my_script.yml

  3. Now you can run your script with ./my_script.yml [additional options]

You can also add some additional options to the #! line if there are specific options that should always be used with your script.

Downloading binary files

When downloading binary files, there is a specific requirement documented here that if you expect to receive binary data from a response, you should specify encoding: null on the request object to ensure that the response is not treated as the default 'UTF-8'. Starting with v0.28.6, as a hyperpotamus convenience, because setting encoding: null is not very intuitive, you can also set binary: true on the request object and it will have the same effect.

Arrays-looping and iteration

Function references in session context

If you have a function loaded into the session context, it can be referenced and invoked using an <%! object_reference %>.

- function: <%! path.to.function %>

**NOTE:** You must use the normalized form with the element wrapper having a `.function` property. This is because interpolation does not happen during the normalization phase,  (there is no session context available). The engine will not know the type of object that the object reference points to and so cannot resolve the proper form.

Clone this wiki locally