1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-15 23:08:16 +08:00

Compare commits

..

No commits in common. "3d51d6307791cf49c2ef28f2c05a542e521d85d7" and "c9bf8b4a84d4ae392cf1bdd6a4a7c7c4f7710b92" have entirely different histories.

2 changed files with 9 additions and 9 deletions

View File

@ -10,28 +10,28 @@ Supported archive formats are:
tlz (tar.lzma), txz (tar.xz), tZ (tar.Z), xz, Z, zip, and zst."
if [[ $# -lt 2 ]]; then
print -u2 -- "$usage"
echo >&2 "$usage"
return 1
fi
local ext="$1"
local input="${2:a}"
local input="$(realpath "$2")"
shift
if [[ ! -e "$input" ]]; then
print -u2 -- "$input not found"
echo >&2 "$input not found"
return 1
fi
# generate output file name
local output
if [[ $# -gt 1 ]]; then
output="${input:h:t}"
output="$(basename "${input%/*}")"
elif [[ -f "$input" ]]; then
output="${input:r:t}"
output="$(basename "${input%.[^.]*}")"
elif [[ -d "$input" ]]; then
output="${input:t}"
output="$(basename "${input}")"
fi
# if output file exists, generate a random name
@ -44,7 +44,7 @@ tlz (tar.lzma), txz (tar.xz), tZ (tar.Z), xz, Z, zip, and zst."
# safety check
if [[ -f "$output" ]]; then
print -u2 -- "output file '$output' already exists. Aborting"
echo >&2 "output file '$output' already exists. Aborting"
return 1
fi
@ -65,6 +65,6 @@ tlz (tar.lzma), txz (tar.xz), tZ (tar.Z), xz, Z, zip, and zst."
Z) compress -vcf "${@}" > "${output}" ;;
zip) zip -rull "${output}" "${@}" ;;
zst) zstd -c -T0 "${@}" > "${output}" ;;
*) print -u2 -- "$usage"; return 1 ;;
*) echo >&2 "$usage"; return 1 ;;
esac
}

View File

@ -286,7 +286,7 @@ function display-release {
local hash subject
for hash message in ${(kv)breaking}; do
echo " - $(fmt:hash) $(fmt:scope)$(fmt:subject "${message}")"
echo " - $(fmt:hash) $(fmt:scope) $(fmt:subject "${message}")"
done | sort
echo
}