chore: add issue_templates and enhence argc version (#14)

This commit is contained in:
sigoden
2024-06-02 17:39:06 +08:00
committed by GitHub
parent 842f5f08c9
commit 80e320217a
4 changed files with 67 additions and 2 deletions
+17 -1
View File
@@ -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