Skip to content

Commit 811137e

Browse files
authored
Move xdg functions into its own package (#542)
## Summary So that I can re-use it in other parts of the code not related to mutagen. ## How was it tested? `go test -v ./...`
1 parent 0ecfdd8 commit 811137e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

internal/cloud/mutagen/wrapper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/pkg/errors"
1212

1313
"go.jetpack.io/devbox/internal/debug"
14+
"go.jetpack.io/devbox/internal/xdg"
1415
)
1516

1617
func Create(spec *SessionSpec) error {
@@ -214,7 +215,7 @@ func envAsKeyValueStrings(userEnv map[string]string) []string {
214215
}
215216

216217
func ensureMutagen() string {
217-
installPath := CacheSubpath("mutagen/bin/mutagen")
218+
installPath := xdg.CacheSubpath("mutagen/bin/mutagen")
218219
err := InstallMutagenOnce(installPath)
219220
if err != nil {
220221
panic(err)

internal/cloud/mutagen/xdg.go renamed to internal/xdg/xdg.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
package mutagen
2-
3-
// TODO: publish as it's own shared package that other binaries
4-
// can use.
1+
package xdg
52

63
import (
74
"os"

0 commit comments

Comments
 (0)