File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 88 "strings"
99 "syscall"
1010
11+ "github.com/depot/cli/pkg/cmd/gocache"
1112 "github.com/depot/cli/pkg/config"
1213 "github.com/depot/cli/pkg/helpers"
1314 "github.com/spf13/cobra"
@@ -52,7 +53,8 @@ func NewCmdCargo() *cobra.Command {
5253 }
5354
5455 // Get authentication token
55- token , err := helpers .ResolveToken (ctx , "" )
56+ token := os .Getenv ("DEPOT_CACHE_TOKEN" )
57+ token , err = helpers .ResolveToken (ctx , token )
5658 if err != nil {
5759 return fmt .Errorf ("failed to resolve token: %w" , err )
5860 }
@@ -72,9 +74,14 @@ func NewCmdCargo() *cobra.Command {
7274 }
7375 }
7476
77+ cacheHost := os .Getenv ("DEPOT_CACHE_HOST" )
78+ if cacheHost == "" {
79+ cacheHost = gocache .DefaultCacheHost
80+ }
81+
7582 // Now add our sccache vars
7683 cargoCmd .Env = append (cargoCmd .Env , fmt .Sprintf ("RUSTC_WRAPPER=%s" , sccachePath ))
77- cargoCmd .Env = append (cargoCmd .Env , "SCCACHE_WEBDAV_ENDPOINT=https://cache.depot.dev" )
84+ cargoCmd .Env = append (cargoCmd .Env , fmt . Sprintf ( "SCCACHE_WEBDAV_ENDPOINT=%s" , cacheHost ) )
7885
7986 if orgID != "" {
8087 // Use org-specific authentication
You can’t perform that action at this time.
0 commit comments