Created
April 26, 2016 11:31
-
-
Save vernak2539/500e5727be1b9c6d6ff77d02401dabae to your computer and use it in GitHub Desktop.
Simple gulp task for initializing paket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You've installed paket in your repo, but the .exe file isn't there, just paket.bootstraper.exe | |
// This sample can be used by gulp to make sure others working on your project can get setup correctly | |
var gulp = require('gulp'); | |
gulp.task('paket:init', [], function(callback) { | |
var paket = spawn('./.paket/paket.bootstrapper.exe', []); | |
var log = function(msg) { | |
msg = msg.toString('utf8'); | |
console.log(msg); | |
}; | |
paket.stdout.on('data', function(msg) { log(msg); }); | |
paket.stderr.on('data', function(msg) { log(msg); }); | |
paket | |
.on('error', function(err) { | |
callback(err); | |
}) | |
.on('exit', function(code) { | |
if(code > 0) { | |
callback(new Error('Download of Paket.exe failed with code ' + code)); | |
return; | |
} | |
callback(); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment