Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-hov committed Dec 16, 2022
1 parent 90097c4 commit f1a1583
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/gnodev/precompile.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func precompileApp(cmd *command.Command, args []string, iopts interface{}) error

func precompilePkg(pkgPath string, opts *precompileOptions) error {
if opts.Output != defaultPrecompileOptions.Output {
fmt.Println("Debug: ", filepath.Join(opts.Output, pkgPath))
if err := os.MkdirAll(filepath.Join(opts.Output, pkgPath), 0700); err != nil {
return err
}
Expand Down
8 changes: 7 additions & 1 deletion cmd/gnodev/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"io"
"log"
"math"
"math/rand"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -50,7 +52,11 @@ func testApp(cmd *command.Command, args []string, iopts interface{}) error {

verbose := opts.Verbose

tempdirRoot, err := os.MkdirTemp("", "gno-precompile")
random := rand.Intn(math.MaxInt32)
tempdirRootName := fmt.Sprintf("gno-precompile-%d", random)
dir := os.TempDir()
tempdirRoot := filepath.Join(dir, tempdirRootName)
err := os.Mkdir(tempdirRoot, 0777)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit f1a1583

Please sign in to comment.