From affb775af3db603527c737bfa07d135a1d5977b3 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 2 Jul 2020 00:04:38 +0800 Subject: Fix detail printing --- gist | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gist b/gist index 594f323..ee0d55f 100755 --- a/gist +++ b/gist @@ -49,7 +49,6 @@ # It is your business to do git commit and git push # FIXME g g s | g l -# FIXME if '@' is inside filename # TODO IF in pipe, do not apply configure # TODO change gist from public to private or reverse versa # TODO feature to exclude tag-value or grep-string @@ -378,7 +377,7 @@ for gist in raw: print(gist["public"], end=" ") print(gist["html_url"], end=" ") print(",".join(file["raw_url"] for file in gist["files"].values()), end=" ") - print(",".join(file["filename"].replace(" ", "-") + "@" + str(file["language"]).replace(" ", "-") for file in gist["files"].values()), end=" ") + print(",".join(file["filename"].replace(" ", "-") + "=" + str(file["language"]).replace(" ", "-") for file in gist["files"].values()), end=" ") print(len(gist["files"]), end=" ") print(gist["comments"], end=" ") print(gist["owner"]["login"], end=" ") @@ -394,7 +393,7 @@ _parse_response() { | while read -r "${INDEX_FORMAT[@]:1:1}" html_url file_url_array "${INDEX_FORMAT[@]:5:7}"; do local gist_id=${html_url##*/} local blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -) - file_array=${file_array//@None/@Text} + file_array=${file_array//=None/=Text} local hashtags_suffix="$(_trailing_hashtags "$description")" description="${description%"$hashtags_suffix"}" @@ -627,7 +626,7 @@ _show_detail() { echo -e created_at: $created_at echo -e updated_at: $updated_at echo -e files: - tr ',' '\n' <<<${file_array//@/ } | column -t | sed -e 's/^/ /' + tr ',' '\n' <<<${file_array//=/ } | column -t | sed -e 's/^/ /' done } -- cgit v1.2.3-70-g09d2