Skip to content

Commit

Permalink
internal/buildcache: write cached builds to /bud/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmueller committed May 15, 2022
1 parent c64854d commit f88458e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion example/basic/view/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

<style>
h1 {
background: red;
background: blue;
padding: 20px;
color: white;
}
</style>
2 changes: 1 addition & 1 deletion internal/bud/bud.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Load(module *gomod.Module) (*Compiler, error) {
}
return &Compiler{
module: module,
bcache: buildcache.Default(),
bcache: buildcache.Default(module),
Env: env,
Stdout: os.Stdout,
Stderr: os.Stderr,
Expand Down
6 changes: 2 additions & 4 deletions internal/buildcache/buildcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ import (
"github.com/livebud/bud/package/gomod"
)

func Default() *Cache {
func Default(module *gomod.Module) *Cache {
return &Cache{
// TODO: make this configurable
// TODO: use the user cache, once we have a way to clean up
Dir: filepath.Join(os.TempDir(), "bud", "cache"),
Dir: filepath.Join(module.Directory(), "bud", "cache"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/bud/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func New(fsys *overlay.FileSystem, module *gomod.Module) *Project {
return &Project{
fsys: fsys,
module: module,
bcache: buildcache.Default(),
bcache: buildcache.Default(module),
Env: os.Environ(),
Stderr: os.Stderr,
Stdout: os.Stdout,
Expand Down

0 comments on commit f88458e

Please sign in to comment.