Skip to content

Conversation

@casssoft
Copy link

Not sure if I was doing something wrong but after

git clone [email protected]:micha/resty.git
. resty
resty HOST
GET /URL

The ~/.resty/c was not created and the cookies were not saved.
I had to create ~/.resty/c myself before the cookies were saved.

Also it looks like the previous code to create the cookie file only ran if the cookie file already exists and overwrote the host file (but not $_RESTY_HOST).

_RESTY_DATA_DIR="$_RESTY_CONF_DIR"
fi
mkdir -p "$_RESTY_CONF_DIR"
mkdir -p "$_RESTY_CONF_DIR/c"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -p is redundant or you can remove the mkdir call above. What you have now is the safest though.

local editor="$_RESTY_EDITOR"
if [[ "POST PUT TRACE PATCH DELETE" =~ $method ]]; then local hasbody; hasbody="yes" ;fi

if [ -d "$cookies" ] ; then # retrieve cookie
Copy link

@pkeller pkeller Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something not right here: why test whether the directory $cookies exists, and then do mkdir -p $cookies if it does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants