Some checks are pending
CI / vet-build-test (push) Waiting to run
- LICENSE: MIT (enables the adoption push; public repo was all-rights-reserved). - go.mod + all imports: git.shoemoney.ai/shoemoney/devbox -> github.com/shoemoney/devbox, so outsiders can 'go install github.com/shoemoney/devbox/cmd/devbox@latest'. Forgejo stays the self-hosted home; the registry (devbox-hub) + public dist (devbox-dist) are unchanged. vet + build + go test -race all green after the rename. - README: document the go install path. Security: full git-history scan (manual blob sweep + gitleaks, 84 commits) found ZERO secrets — Forgejo token never committed, no keys/passwords/private keys.
32 lines
804 B
Go
32 lines
804 B
Go
//go:build darwin
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/shoemoney/devbox/internal/config"
|
|
)
|
|
|
|
func TestProtectedMounts(t *testing.T) {
|
|
home, err := os.UserHomeDir()
|
|
if err != nil {
|
|
t.Skip("no home dir")
|
|
}
|
|
mounts := []config.Mount{
|
|
{Local: filepath.Join(home, "Documents", "work")},
|
|
{Local: filepath.Join(home, "Desktop")},
|
|
{Local: "/tmp/devbox-not-protected"},
|
|
{Local: filepath.Join(home, "Library", "Mobile Documents", "iCloud~x")},
|
|
}
|
|
got := protectedMounts(mounts)
|
|
if len(got) != 3 {
|
|
t.Fatalf("protectedMounts = %v, want 3 (Documents, Desktop, iCloud — not /tmp)", got)
|
|
}
|
|
// A readable dir is never reported as TCC-blocked.
|
|
if b := blockedByTCC([]string{t.TempDir()}); len(b) != 0 {
|
|
t.Fatalf("a readable dir was reported blocked: %v", b)
|
|
}
|
|
}
|