From 18a503735ce865121d964c4d2d1c768fbd85bc6d Mon Sep 17 00:00:00 2001 From: Morgan Date: Mon, 6 Nov 2023 18:57:57 +0100 Subject: [PATCH] fix(misc/list-gnophers): make script work when called from any directory (#1308) \+ use a tmpdir for the csv file. @moul
Contributors' checklist... - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x ] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [x] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
--- misc/list-gnophers/main.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/list-gnophers/main.sh b/misc/list-gnophers/main.sh index beb90d4c767..0b230e97948 100755 --- a/misc/list-gnophers/main.sh +++ b/misc/list-gnophers/main.sh @@ -1,12 +1,13 @@ #!/bin/sh main() { + cd "$(dirname "$0")" cd ../.. + fname="$(mktemp --tmpdir gno_file_commits.XXXXXXXXXX.csv)" for file in $(list_gno_files); do extract_file_metadata $file - done > gno_file_commits.csv - echo - cat gno_file_commits.csv | sort_by_date | unique_by_author + done > "$fname" + cat "$fname" | sort_by_date | unique_by_author } list_gno_files() {