diff --git a/data-export/export.sh b/data-export/export.sh index c12d6e081..fdfb3b247 100755 --- a/data-export/export.sh +++ b/data-export/export.sh @@ -1,10 +1,8 @@ -#!/usr/bin/env bash -set -o errexit -o errtrace -o noclobber -o nounset -o pipefail -IFS=$'\n\t' +#!/usr/bin/env sh -script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +script_dir=$(cd "$(dirname "$0")" && pwd) -function usage() { +usage() { if [ -n "${1:-}" ]; then >&2 cat <&2 cat <query(file_get_contents('$filename'))->fetchAll()" --format=json >| "$output_filename" || true ls -lh "$output_filename" # CSV - output_filename=${filename/%.sql/.csv} + output_filename="$filename.csv" # https://stackoverflow.com/a/22421445/2502647 vendor/bin/drush --uri="$site_uri" sql:cli < "$filename" | awk 'BEGIN { FS="\t"; OFS="," } { rebuilt=0