~yerinalexey/gobin

0b93da800ff981fe09d65ff096d9f53a036e1dcb — Alexey Yerin 3 months ago 256a1bd master
gobin-migrate: use tr to cut off quotes and space
1 files changed, 1 insertions(+), 1 deletions(-)

M gobin-migrate
M gobin-migrate => gobin-migrate +1 -1
@@ 44,7 44,7 @@ parse_config() {
  # circumstances

  # gobin accepts both databaseUri or database_uri
  database_uri="$(awk -F '=' '/^(databaseUri|database_uri)/ { gsub(/[ "]/, ""); print $2 }' "$config")"
  database_uri="$(awk -F '=' '/^(databaseUri|database_uri)/ { print $2 }' "$config" | tr -d " '\"")"

  if [ -z "$database_uri" ]; then
    printf 'Complicated TOML or databaseUri (database_uri) field is missing\n'