real fix for: gulp-symdest does not preserve links on electron #2

This commit is contained in:
Benjamin Pasero 2015-11-16 16:10:25 +01:00
parent 045e1b6dd4
commit a4bfcb890d
2 changed files with 3 additions and 41 deletions

View file

@ -11,8 +11,7 @@ var path = require('path');
var es = require('event-stream'); var es = require('event-stream');
var azure = require('gulp-azure-storage'); var azure = require('gulp-azure-storage');
var electron = require('gulp-atom-electron'); var electron = require('gulp-atom-electron');
var mkdirp = require('mkdirp'); var symdest = require('gulp-symdest');
var vfs = require('vinyl-fs');
var rename = require('gulp-rename'); var rename = require('gulp-rename');
var filter = require('gulp-filter'); var filter = require('gulp-filter');
var json = require('gulp-json-editor'); var json = require('gulp-json-editor');
@ -39,10 +38,6 @@ var baseModules = [
// Build // Build
var builtInExtensions = {
// nothing yet
};
var vscodeEntryPoints = _.flatten([ var vscodeEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.main'), buildfile.entrypoint('vs/workbench/workbench.main'),
buildfile.base, buildfile.base,
@ -138,33 +133,6 @@ function mixinProduct() {
})); }));
} }
// Writes to destination with support for symlinks as they can appear in Electron on Mac
function symdest(out) {
var pass = es.through();
return es.duplex(pass,
pass.pipe(es.mapSync(function (f) {
if (!f.symlink) {
return f;
}
var dest = path.join(out, f.relative);
try {
mkdirp.sync(path.dirname(dest));
} catch (error) {
// Folder exists
}
try {
fs.symlinkSync(f.symlink, dest);
} catch (error) {
console.error('Problem writing symlink: ' + error);
}
}))
.pipe(vfs.dest(out))
);
};
function packageTask(platform, arch, opts) { function packageTask(platform, arch, opts) {
opts = opts || {}; opts = opts || {};
@ -215,11 +183,6 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], true)) .pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], true))
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], true)); .pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], true));
var extraExtensions = util.downloadExtensions(builtInExtensions)
.pipe(rename(function (p) {
p.dirname = path.posix.join('extensions', p.dirname);
}));
var resources = gulp.src('resources/*', { base: '.' }); var resources = gulp.src('resources/*', { base: '.' });
if (platform === 'win32') { if (platform === 'win32') {
@ -235,7 +198,6 @@ function packageTask(platform, arch, opts) {
license, license,
sources, sources,
deps, deps,
extraExtensions,
resources resources
).pipe(util.skipDirectories()); ).pipe(util.skipDirectories());

View file

@ -54,6 +54,7 @@
"gulp-tsb": "^1.7.3", "gulp-tsb": "^1.7.3",
"gulp-uglify": "^1.4.1", "gulp-uglify": "^1.4.1",
"gulp-util": "^3.0.6", "gulp-util": "^3.0.6",
"gulp-symdest": "^1.0.0",
"gulp-vinyl-zip": "^1.1.0", "gulp-vinyl-zip": "^1.1.0",
"gulp-watch": "^4.2.4", "gulp-watch": "^4.2.4",
"innosetup-compiler": "^5.5.60", "innosetup-compiler": "^5.5.60",
@ -73,8 +74,7 @@
"source-map": "^0.4.4", "source-map": "^0.4.4",
"uglify-js": "2.4.8", "uglify-js": "2.4.8",
"underscore": "^1.8.2", "underscore": "^1.8.2",
"vinyl": "^0.4.5", "vinyl": "^0.4.5"
"vinyl-fs": "^2.2.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",