aspnetcore/build/_grunt.shade

16 lines
1.1 KiB
Plaintext

default currentDir = '${Directory.GetCurrentDirectory()}'
default nodeDir = '${Path.Combine(currentDir, "bin", "nodejs")}'
var gruntCliLibrary = '${ Path.Combine(nodeDir, "node_modules", "grunt-cli", "bin", "grunt") }'
var gruntCliInstalled = '${ File.Exists(gruntCliLibrary) }'
default gruntCliGloballyInstalled = '${ !gruntCliInstalled && TestCommand("grunt", "--version") }'
var gruntCmd = '${ gruntCliGloballyInstalled ? "grunt" : gruntCliLibrary }'
- // Install grunt-cli locally if not already installed either globally or locally; creates gruntCliLibrary file if run
var installCommand = 'install ${E("KOREBUILD_NPM_INSTALL_OPTIONS")} --prefix "${nodeDir}" grunt-cli'
npm npmCommand='${installCommand}' if='!(gruntCliGloballyInstalled || gruntCliInstalled)' once='installGruntCli'
-// Run grunt-cli
exec program='cmd' commandline='/C ${gruntCmd}' workingdir='${gruntDir}' if='gruntCliGloballyInstalled && !IsLinux'
exec program='${gruntCmd}' workingdir='${gruntDir}' if='gruntCliGloballyInstalled && IsLinux'
node nodeCommand='"${gruntCmd}"' workingdir='${gruntDir}' if='!gruntCliGloballyInstalled'