mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
devvm is one file: assets/ (base.yaml, layers/, features/, shared-tools/, guest/, oci/, smolvm/) is embedded as assets.FS, which cli passes to every constructor; backends, the builder, the shared tools, the proxy and Ubuntu's key check read it as an fs.FS. Scripts reach VMs on stdin (backend.Script carries their contents). What needs a path (limactl create's base.yaml, oci/ mounted into the conversion VM, the proxies' policy files) is written out to ~/.local/share/devvm/assets/<hash>, atomically, files 600 and folders 700; devvm gc deletes older copies no VM's proxy was started with (gc_assets, deleted_assets). Release archives hold the binary with README.md, CHANGELOG.md and LICENSE, and the formula installs the binary alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
32 lines
882 B
Go
32 lines
882 B
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/w3cj/devvm/assets"
|
|
"github.com/w3cj/devvm/internal/msg"
|
|
"github.com/w3cj/devvm/internal/paths"
|
|
"github.com/w3cj/devvm/internal/tools"
|
|
"github.com/w3cj/devvm/internal/ui"
|
|
)
|
|
|
|
// newRefreshToolsCmd is devvm _refresh-tools: the daily check for newer
|
|
// shared tools, which devvm starts in the background (tools.RefreshDaily).
|
|
// Hidden: it's not for users.
|
|
func newRefreshToolsCmd(u *ui.UI) *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "_refresh-tools",
|
|
Short: "Resolve the shared tools' versions again",
|
|
Hidden: true,
|
|
Args: cobra.NoArgs,
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
dirs, err := paths.FromEnv()
|
|
if err == nil {
|
|
err = tools.New(dirs, assets.FS, u).Refresh(cmd.Context())
|
|
}
|
|
fail(u, err, func(string) msg.M { return msg.ToolsCheckFailed() })
|
|
return nil
|
|
},
|
|
}
|
|
}
|