Skip to content

Commit 103ee94

Browse files
committed
WIP
1 parent 950536e commit 103ee94

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/cmd/package.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package cmd
22

33
import (
4+
"crypto/sha256"
5+
"fmt"
46
"io"
57
"os"
68

@@ -32,7 +34,14 @@ func createPkg(e Env, dir, filename string, stderr io.Writer) error {
3234
return err
3335
}
3436

35-
if err := os.WriteFile("sqlc-package-test.tar.gz", tarball, 0644); err != nil {
37+
// TODO: Move this to the configuration file
38+
owner := "tabbed"
39+
project := "sqlc"
40+
41+
checksum := sha256.Sum256(tarball)
42+
sha := fmt.Sprintf("%x", checksum)
43+
output := fmt.Sprintf("%s_%s_%s.tar.gz", owner, project, sha[:10])
44+
if err := os.WriteFile(output, tarball, 0644); err != nil {
3645
return err
3746
}
3847

0 commit comments

Comments
 (0)