From 16f2868e5bb7b23420c70ee947edded5e381655a Mon Sep 17 00:00:00 2001 From: sigoden Date: Sun, 2 Jun 2024 09:36:07 +0000 Subject: [PATCH] chore: add issue_templates and enhence `argc version` --- .github/ISSUE_TEMPLATE/bug_report.md | 28 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 22 ++++++++++++++++++ Argcfile.sh | 18 ++++++++++++++- README.md | 1 - 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f8534c9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,28 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + +**Describe the bug** + + +**Expected behavior** + + +**Screenshots/Logs** + + +**Environment** + + +**Additional context** + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..4c0f08c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + + + +**Is your feature request related to a problem? Please describe.** + + +**Describe the solution you'd like** + + +**Describe alternatives you've considered** + + +**Additional context** + \ No newline at end of file diff --git a/Argcfile.sh b/Argcfile.sh index 5b102fe..f1496ed 100644 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -178,9 +178,17 @@ install() { # @cmd Show versions of required tools for bug reports. version() { + uname -a argc --argc-version jq --version - curl --version | head -n 1 + for item in "${LANG_CMDS[@]}"; do + cmd="${item#*:}" + if [[ "$cmd" == "bash" ]]; then + echo "$(argc --argc-shell-path) $("$(argc --argc-shell-path)" --version | head -n 1)" + elif command -v "$cmd" &> /dev/null; then + echo "$(_normalize_path "$(which $cmd)") $($cmd --version)" + fi + done } _lang_to_cmd() { @@ -213,6 +221,14 @@ $run "%script_dir%cmd\cmd.$lang" "%script_name%.$lang" %* EOF } +_normalize_path() { + if _is_win; then + cygpath -w "$1" + else + echo "$1" + fi +} + _is_win() { if [[ "$OS" == "Windows_NT" ]]; then return 0 diff --git a/README.md b/README.md index 6223976..e2e8f42 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ Make sure you have the following tools installed: - [argc](https://github.com/sigoden/argc): A bash command-line framewrok and command runner - [jq](https://github.com/jqlang/jq): A JSON processor -- [curl](https://curl.se): A command-line tool for transferring data with URLs ## Getting Started with AIChat