13 [[ -s $version.zip ]] && exit
16 zipcreate=$root/zip-create
17 ziphash=$root/zip-hash
18 zmodload -F zsh/datetime b:strftime
19 git -C $vcspath cat-file -p $version | while read line ; do
20 [[ $line =~ ^object ]] && hsh=${${=line}[-1]}
21 [[ $line =~ ^tagger ]] && {
22 strftime -s sec -r "%s %z" "${${=line}[-2,-1]}"
28 strftime -s when %Y-%m-%dT%H:%M:%SZ $sec
30 $zipcreate -vcs $vcspath -mod $modname -version $version > $version.zip
31 $ziphash $version.zip > $version.ziphash
32 unzip -p $version.zip ${modname}@${version}/go.mod > $version.mod
33 printf '{"Version":"%s","Time":"%s","Origin":{"VCS":"git","URL":"%s","Ref":"refs/tags/%s","Hash":"%s"}}' \
34 $version $when $vcsurl $version $hsh > $version.info
35 touch -d $when $version.info $version.mod $version.zip $version.ziphash