mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
function name change
This commit is contained in:
@@ -44,7 +44,7 @@ func NewNpmCommand() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For non-install actions, just pass through to npm
|
// For non-install actions, just pass through to npm
|
||||||
npmPath, err := utils.GetInterpreterPath("npm")
|
npmPath, err := utils.GetExecutablePath("npm")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("npm not found: %w", err)
|
return fmt.Errorf("npm not found: %w", err)
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ func wrapNpm() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the npm PATH
|
// Get the npm PATH
|
||||||
npmPath, err := utils.GetInterpreterPath("npm")
|
npmPath, err := utils.GetExecutablePath("npm")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("npm not found: %w", err)
|
return fmt.Errorf("npm not found: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ type ExtractorOptions struct {
|
|||||||
|
|
||||||
// RunExtractor extracts an embedded script to a temp file and executes it
|
// RunExtractor extracts an embedded script to a temp file and executes it
|
||||||
func RunPkgExtractor(opts ExtractorOptions) (string, error) {
|
func RunPkgExtractor(opts ExtractorOptions) (string, error) {
|
||||||
interpreterPath, err := utils.GetInterpreterPath(opts.Interpreter)
|
interpreterPath, err := utils.GetExecutablePath(opts.Interpreter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetInterpreterPath(name string) (string, error) {
|
func GetExecutablePath(name string) (string, error) {
|
||||||
path, err := exec.LookPath(name)
|
path, err := exec.LookPath(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("interpreter '%s' not found in PATH: %s", name, err.Error())
|
return "", fmt.Errorf("interpreter '%s' not found in PATH: %s", name, err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user