whiteinge/ok.sh

repo creation fails

Closed this issue · 4 comments

Describe the bug

As of 502011c, creating a repo with ok.sh create_repo foo fails with:

martinmac:ok.sh brightm$ ./ok.sh create_repo foo
awk: newline in string OK_SH_ACCEPT
OK_SH_U... at source line 1
awk: newline in string OK_SH_ACCEPT
OK_SH_U... at source line 1
awk: newline in string OK_SH_ACCEPT
OK_SH_U... at source line 1
Client Error: 400 Bad Request
martinmac:ok.sh brightm$

Environment (please complete the following information)

  • ok.sh release: 502011c
  • curl version: curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.4 zlib/1.2.11 nghttp2/1.24.1
  • jq version: jq-1.6
  • What operating system and version.
ProductName:	Mac OS X
ProductVersion:	10.14.3
BuildVersion:	18D109
  • shell:
GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Additional context

I git bisected the problem to: 502011c.

Hm. I'm trying to reproduce it on a Linux machine and it's working as expected so I'll try it on a Mac early tomorrow and report back. Thanks for the detailed bug report.

Odd error message (possibly a red herring). Are you using the default OK_SH_ACCEPT var or have you overridden it?

Ok, I was able to reproduce on a Mac. (I'd like to know why there's that difference between the two systems...) I think #81 should do the trick. That fix is also a much more sane approach to formatting JSON using awk than what I had been using. 😛

If you have a sec to kick the tires for that PR, I'd appreciate a second pair of eyes. I'll give it a final test tomorrow on a Mac before merging.

#81 works for me. Thank you 👍

Thanks for the quick report.