Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created February 18, 2014 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronpowell/9061899 to your computer and use it in GitHub Desktop.
Save aaronpowell/9061899 to your computer and use it in GitHub Desktop.
TFS PowerTools undo unchanged files
var tfptPath = 'C:\\Program Files (x86)\\Microsoft Team Foundation Server 2013 Power Tools\\TFPT.EXE';
grunt.registerTask('tfpt-uu', 'Undo changes to unchanged files in the workspace (required TFs PowerTools 2013', function () {
var fs = require('fs');
var cb = this.async();
fs.exists(tfptPath, function (exists) {
if (!exists) {
grunt.warn('TFS Power Tools are not installed, aborting...');
cb();
return;
}
var child = grunt.util.spawn({
cmd: tfptPath,
args: ['uu', '/recursive']
}, function (err, result, code) {
if (err) {
grunt.fatal(err);
}
cb();
});
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment