gulp-symdest does not preserve links on electron (fixes #2)
parent
6f9e2ae390
commit
0a2f0cbc5c
|
@ -11,10 +11,11 @@ var path = require('path');
|
|||
var es = require('event-stream');
|
||||
var azure = require('gulp-azure-storage');
|
||||
var electron = require('gulp-atom-electron');
|
||||
var mkdirp = require('mkdirp');
|
||||
var vfs = require('vinyl-fs');
|
||||
var rename = require('gulp-rename');
|
||||
var filter = require('gulp-filter');
|
||||
var json = require('gulp-json-editor');
|
||||
var symdest = require('gulp-symdest');
|
||||
var insert = require('gulp-insert');
|
||||
var remote = require('gulp-remote-src');
|
||||
var File = require('vinyl');
|
||||
|
@ -137,6 +138,33 @@ 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) {
|
||||
opts = opts || {};
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
"gulp-remote-src": "^0.4.0",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-sourcemaps": "^1.6.0",
|
||||
"gulp-symdest": "^1.0.0",
|
||||
"gulp-tsb": "^1.7.3",
|
||||
"gulp-uglify": "^1.4.1",
|
||||
"gulp-util": "^3.0.6",
|
||||
|
@ -74,7 +73,8 @@
|
|||
"source-map": "^0.4.4",
|
||||
"uglify-js": "2.4.8",
|
||||
"underscore": "^1.8.2",
|
||||
"vinyl": "^0.4.5"
|
||||
"vinyl": "^0.4.5",
|
||||
"vinyl-fs": "^2.2.1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Loading…
Reference in New Issue