Documentation
¶
Index ¶
- Variables
- func CmdExists(cmd string) bool
- func CompleteDependencies(_ *cobra.Command, _ []string, _ string) ([]cobra.Completion, cobra.ShellCompDirective)
- func DefaultRunCommand(cmd *cobra.Command, remaining []string)
- func FileExists(path string) bool
- func GetCorepackManager() string
- func GetPackageManager() string
- func GetShebang(filePath string) (string, []string)
- func GuessPackageManager() string
- func RunAliasCommand(name string, alias string, args []string, remaining ...string)
- func RunCommand(name string, args []string, remaining ...string)
- func RunScriptCommand(cmd *cobra.Command, remaining []string)
- type Package
Constants ¶
This section is empty.
Variables ¶
View Source
var GetPackageJson = sync.OnceValue(func() *Package { data, err := os.ReadFile("package.json") if err != nil { if !errors.Is(err, fs.ErrNotExist) { fmt.Println("warn: failed to read 1package.json") } return nil } var pkg Package err = json.Unmarshal(data, &pkg) if err != nil { fmt.Println("warn: failed to parse package.json") return nil } return &pkg })
Functions ¶
func CompleteDependencies ¶
func CompleteDependencies(_ *cobra.Command, _ []string, _ string) ([]cobra.Completion, cobra.ShellCompDirective)
func DefaultRunCommand ¶
func FileExists ¶
func GetCorepackManager ¶
func GetCorepackManager() string
func GetPackageManager ¶
func GetPackageManager() string
func GetShebang ¶ added in v1.1.0
GetShebang returns the interpreter and args from a file's shebang line. If no shebang is present, returns empty manager and nil args.
func GuessPackageManager ¶
func GuessPackageManager() string
func RunAliasCommand ¶
func RunCommand ¶
func RunScriptCommand ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.