mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
feat: enhance Node.js environment configuration in task runner
- Added a new utility function GetNodeBinPath to retrieve the global node_bin path from configuration, with a default fallback. - Updated configureNodePath method to set the PATH environment variable to include the node_bin path if it's not already present, improving the task runner's environment setup for Node.js development.
This commit is contained in:
@@ -364,6 +364,12 @@ func (r *Runner) configureNodePath() {
|
||||
_ = os.Setenv("PATH", nodePath+":"+envPath)
|
||||
}
|
||||
_ = os.Setenv("NODE_PATH", nodePath)
|
||||
|
||||
// Configure global node_bin path
|
||||
nodeBinPath := utils.GetNodeBinPath()
|
||||
if !strings.Contains(envPath, nodeBinPath) {
|
||||
_ = os.Setenv("PATH", nodeBinPath+":"+envPath)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Runner) configureGoPath() {
|
||||
|
||||
Reference in New Issue
Block a user