Skip to content

Commit 21b0a95

Browse files
Add copy_sha256.sh
1 parent 1998e56 commit 21b0a95

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

misc/copy_sha256.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if [ $# -eq 0 ]; then
2+
echo "A tag argument is needed!(ex: ./copy_sha256 1.2.3)"
3+
exit 1
4+
fi
5+
tag=$1
6+
echo "Tag: '${tag}'"
7+
filename="${tag}.tar.gz"
8+
echo "Filename: '${filename}'"
9+
curl -LOk "https://github.com/ShotaKashihara/atcoder-cli-swift/archive/${filename}"
10+
result=$(shasum -a 256 $filename)
11+
echo "Result: '${result}'"
12+
sha256=$(echo ${result} | cut -d ' ' -f 1)
13+
echo $sha256 | tr -d '\n' | pbcopy
14+
echo "sha256('${sha256}') was copied to your clipboard🎉"
15+
rm $filename

0 commit comments

Comments
 (0)