Short-circuit `TestCommand()` calls once commands are installed locally
This commit is contained in:
parent
56f45e0c7d
commit
7431356913
|
|
@ -1,8 +1,8 @@
|
|||
default currentDir = '${Directory.GetCurrentDirectory()}'
|
||||
default nodeDir = '${Path.Combine(currentDir, "bin", "nodejs")}'
|
||||
|
||||
var bowerGloballyInstalled = '${TestCommand("bower", "--version")}'
|
||||
var bowerInstalled = '${Directory.Exists(Path.Combine(nodeDir, "node_modules", "bower"))}'
|
||||
var bowerGloballyInstalled = '${ !bowerInstalled && TestCommand("bower", "--version") }'
|
||||
var bowerCmd = '${ bowerGloballyInstalled ? "bower" : Path.Combine(nodeDir, "node_modules", "bower", "bin", "bower") }'
|
||||
|
||||
- // Install bower locally if not already installed either globally or locally
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
default currentDir = '${Directory.GetCurrentDirectory()}'
|
||||
default nodeDir = '${Path.Combine(currentDir, "bin", "nodejs")}'
|
||||
|
||||
var gruntCliGloballyInstalled = '${TestCommand("grunt", "--version")}'
|
||||
var gruntCliInstalled = '${Directory.Exists(Path.Combine(nodeDir, "node_modules", "grunt-cli"))}'
|
||||
var gruntCliGloballyInstalled = '${ !gruntCliInstalled && TestCommand("grunt", "--version") }'
|
||||
var gruntCmd = '${ gruntCliGloballyInstalled ? "grunt" : Path.Combine(nodeDir, "node_modules", "grunt-cli") }'
|
||||
|
||||
-// Install grunt-cli locally
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ default nodeVer = '0.10.28'
|
|||
default npmVer = '1.4.9'
|
||||
default nodeExeSha = '628FFD6C3577068C00CEC9F6F897F0EC8F5212D9'
|
||||
default nodeInstallDir = '${Path.Combine(binDir, "nodejs")}'
|
||||
default nodeGloballyInstalled = '${TestCommand("node" , "--version")}'
|
||||
default nodeGloballyInstalled = '${ !Directory.Exists(nodeInstallDir) && TestCommand("node" , "--version") }'
|
||||
|
||||
var nodeExe = 'node.exe'
|
||||
var npmZip = 'npm-${npmVer}.zip'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
default currentDir = '${Directory.GetCurrentDirectory()}'
|
||||
default nodeDir = '${Path.Combine(currentDir, "bin", "node")}'
|
||||
default nodeGloballyInstalled = '${TestCommand("node", "--version")}'
|
||||
|
||||
var nodeExePath = '${ nodeGloballyInstalled ? "node" : Path.Combine(nodeDir, "node.exe") }'
|
||||
|
||||
node-install once='installNode'
|
||||
|
||||
var nodeExeFile = '${ Path.Combine(nodeDir, "node.exe") }'
|
||||
var nodeExePath = '${ File.Exists(nodeExeFile) ? nodeExeFile : "node" }'
|
||||
|
||||
exec program='${nodeExePath}' commandline='${nodeCommand}'
|
||||
|
|
@ -2,9 +2,10 @@ default currentDir = '${Directory.GetCurrentDirectory()}'
|
|||
default nodeDir = '${Path.Combine(currentDir, "bin", "nodejs")}'
|
||||
default npmDir = '${currentDir}'
|
||||
|
||||
var npmGloballyInstalled = '${TestCommand("npm" , "--version")}'
|
||||
var npmCmd = '${ npmGloballyInstalled ? "npm" : Path.Combine(nodeDir, "npm.cmd") }'
|
||||
|
||||
node-install once='installNode'
|
||||
|
||||
var npmFile = '${ Path.Combine(nodeDir, "npm.cmd") }'
|
||||
var npmCmd = '${ File.Exists(npmFile) ? npmFile : "npm" }'
|
||||
|
||||
exec program='cmd' commandline='/C ${npmCmd} ${npmCommand}' workingdir='${npmDir}' if='!IsLinux'
|
||||
exec program='${npmCmd}' commandline='${npmCommand}' workingdir='${npmDir}' if='IsLinux'
|
||||
exec program='${npmCmd}' commandline='${npmCommand}' workingdir='${npmDir}' if='IsLinux'
|
||||
Loading…
Reference in New Issue