mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
* feat: Add support for sandbox edit command * docs: Update sandbox docs * fix(editor): address review — neutral failure wording, skip sh-script tests on Windows Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(test): avoid pnpm init in pm-e2e — devEngines.packageManager crashes subsequent pnpm add Same workaround and rationale as the PNPM job in pmg-e2e.yml. Latest pnpm (unpinned pnpm/action-setup) writes devEngines.packageManager with onFail:download on init, and the next add fails with "Cannot use 'in' operator to search for 'integrity' in undefined". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package sandbox
|
|
|
|
import (
|
|
"github.com/safedep/pmg/config"
|
|
pmgsandbox "github.com/safedep/pmg/sandbox"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// registryFactory builds a ProfileRegistry. Tests inject a stub.
|
|
type registryFactory func() (pmgsandbox.ProfileRegistry, error)
|
|
|
|
func defaultRegistryFactory() (pmgsandbox.ProfileRegistry, error) {
|
|
return pmgsandbox.NewProfileRegistry(
|
|
pmgsandbox.WithUserProfileDir(config.Get().SandboxProfileDir()),
|
|
)
|
|
}
|
|
|
|
// NewProfileCommand returns the `pmg sandbox profile` parent command.
|
|
func NewProfileCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "profile",
|
|
Short: "Inspect sandbox profiles",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
|
|
cmd.AddCommand(newProfileListCommand(defaultRegistryFactory))
|
|
cmd.AddCommand(newProfileShowCommand(defaultRegistryFactory))
|
|
cmd.AddCommand(newProfileInitCommand(defaultRegistryFactory))
|
|
cmd.AddCommand(newProfileEditCommand(defaultRegistryFactory))
|
|
cmd.AddCommand(newProfileLintCommand(defaultRegistryFactory))
|
|
cmd.AddCommand(newProfileDiffCommand(defaultRegistryFactory))
|
|
return cmd
|
|
}
|