Skip to content

Strict mode bash #71

@ghost

Description

Hi.

I was hoping to use resty in a REST API test suite written in bash, but I'm finding it's not set up to be run with set -u (nounset) (at least).

Steps to repeat:

#!/bin/bash

set -o errtrace
set -o functrace
set -o pipefail
set -o nounset
source "${RESTY}" -W "${API_BASE_URI}"

GET /

If I put the set -o nounset before the source, then the resty command at the end of the source file fails (e.g. resty http://localhost). If I put the set -o nounset after source but before the GET line, I get:

+ resty GET /
+ local confdir datadir host cookies method h2t editor domain _path opt dat res ret out err verbose raw i j d tmpf args2 wantdata vimedit quote query maybe_query dry
+ local -a curlopt
+ local -a curlopt2
/home/vagrant/repos/resty/resty: line 21: XDG_CONFIG_HOME: unbound variable

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions