This commit is contained in:
Daniel Lebu 2016-03-18 11:30:38 -07:00
Родитель de532fd7d7
Коммит 7212311dca
2 изменённых файлов: 26 добавлений и 2 удалений

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
var child_process = require('child_process');
var gulp = require('gulp');
var log = require('gulp-util').log;
var sourcemaps = require('gulp-sourcemaps');
@ -13,6 +12,7 @@ var mocha = require('gulp-mocha');
var GulpExtras = require("./tools/gulp-extras");
var copyright = GulpExtras.checkCopyright;
var imports = GulpExtras.checkImports;
var executeCommand = GulpExtras.executeCommand;
var srcPath = 'src';
var outPath = 'out';
@ -106,3 +106,9 @@ gulp.task("clean", function () {
});
return del(pathsToDelete, { force: true });
});
gulp.task("package", function (callback) {
var command = path.join(__dirname, "node_modules", ".bin", "vsce");
var args = ["package"];
executeCommand(command, args, callback);
});

Просмотреть файл

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for details.
"use strict";
var child_process = require("child_process");
var fs = require("fs");
var gutil = require("gulp-util");
var path = require("path");
@ -99,7 +100,24 @@ var checkImports = function() {
});
};
var executeCommand = function(command, args, callback) {
var process = child_process.spawn(command, args);
process.stdout.on('data', function(data) {
console.log("" + data);
});
process.stderr.on('data', function(data) {
console.error("" + data);
});
process.on('exit', function(code) {
callback(code === 0 ? undefined : "Error code: " + code);
});
};
module.exports = {
checkCopyright: checkCopyright,
checkImports: checkImports
checkImports: checkImports,
executeCommand: executeCommand
}