diff --git a/tools/sign.fish b/tools/sign.fish new file mode 100755 index 0000000..ce9d26b --- /dev/null +++ b/tools/sign.fish @@ -0,0 +1,22 @@ +#!/usr/bin/fish + +function dosign + if test 2 -gt (count {$argv}) + echo "dosign:" + echo "用法: dosign [KEY] [FILES]..." + echo "参数:" + echo " [KEY] 指定用于签名的密钥。" + echo " [FILES]... 要签名的目标文件。" + return 1 + end + + for target in {$argv[2..]} + echo "sign: $target" + gpg --local-user {$argv[1]} --detach-sign {$target} + end +end + +if test 2 -le (count {$argv}) + echo "使用参数 $argv 运行 dosign…" + dosign {$argv} +end