Initial
This commit is contained in:
1
Client/node_modules/gulp-symdest/.npmignore
generated
vendored
Executable file
1
Client/node_modules/gulp-symdest/.npmignore
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
22
Client/node_modules/gulp-symdest/LICENSE
generated
vendored
Executable file
22
Client/node_modules/gulp-symdest/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 João Moreno
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
21
Client/node_modules/gulp-symdest/README.md
generated
vendored
Executable file
21
Client/node_modules/gulp-symdest/README.md
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
# gulp-symdest
|
||||
|
||||
Like gulp.dest, but handles symlinks.
|
||||
|
||||
## Details
|
||||
|
||||
It assumes that if a [vinyl](https://github.com/wearefractal/vinyl) file
|
||||
has a field `symlink`, then it is a `string` with the value for the
|
||||
symlink itself.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var symdest = require('gulp-symdest');
|
||||
|
||||
gulp.task('default', function () {
|
||||
return gulp.src('path_with_symlinks/**')
|
||||
.pipe(symdest('out'));
|
||||
});
|
||||
```
|
||||
50
Client/node_modules/gulp-symdest/index.js
generated
vendored
Executable file
50
Client/node_modules/gulp-symdest/index.js
generated
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var mkdirp = require('mkdirp');
|
||||
var vfs = require('vinyl-fs');
|
||||
var es = require('event-stream');
|
||||
var queue = require('queue');
|
||||
|
||||
function createSymlink(dest, symlink, cb) {
|
||||
mkdirp(path.dirname(dest), function (err) {
|
||||
if (err) { return cb(err); }
|
||||
|
||||
fs.symlink(symlink, dest, cb);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = function (out) {
|
||||
var pass = es.through();
|
||||
var symlinks = [];
|
||||
|
||||
return es.duplex(pass,
|
||||
pass.pipe(es.mapSync(function (f) {
|
||||
if (!f.symlink) {
|
||||
return f;
|
||||
}
|
||||
|
||||
symlinks.push(f);
|
||||
}))
|
||||
.pipe(vfs.dest(out))
|
||||
.pipe(es.through(null, function () {
|
||||
var q = queue();
|
||||
q.concurrency = 1;
|
||||
q.timeout = 1000;
|
||||
|
||||
var that = this;
|
||||
symlinks.forEach(function (f) {
|
||||
q.push(function (cb) {
|
||||
createSymlink(path.join(out, f.relative), f.symlink, cb);
|
||||
});
|
||||
});
|
||||
|
||||
q.start(function (err) {
|
||||
if (err) {
|
||||
that.emit('error', err);
|
||||
} else {
|
||||
that.emit('end');
|
||||
}
|
||||
});
|
||||
}))
|
||||
);
|
||||
};
|
||||
63
Client/node_modules/gulp-symdest/package.json
generated
vendored
Executable file
63
Client/node_modules/gulp-symdest/package.json
generated
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"_from": "gulp-symdest@^1.1.0",
|
||||
"_id": "gulp-symdest@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-wWUyBzLRks5W/ZQnH/oSMjS/KuA=",
|
||||
"_location": "/gulp-symdest",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "gulp-symdest@^1.1.0",
|
||||
"name": "gulp-symdest",
|
||||
"escapedName": "gulp-symdest",
|
||||
"rawSpec": "^1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/vscode"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-symdest/-/gulp-symdest-1.1.0.tgz",
|
||||
"_shasum": "c165320732d192ce56fd94271ffa123234bf2ae0",
|
||||
"_spec": "gulp-symdest@^1.1.0",
|
||||
"_where": "/home/nathan/Projects/Upsilon/UpsilonVsCodeLanguageServer/Client/node_modules/vscode",
|
||||
"author": {
|
||||
"name": "João Moreno"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/joaomoreno/gulp-symdest/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"event-stream": "^3.3.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"queue": "^3.1.0",
|
||||
"vinyl-fs": "^2.4.3"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Like gulp.dest, but handles symlinks",
|
||||
"devDependencies": {
|
||||
"event-stream": "^3.3.2",
|
||||
"mocha": "^2.3.3",
|
||||
"tmp": "0.0.28",
|
||||
"vinyl": "^1.1.0"
|
||||
},
|
||||
"homepage": "https://github.com/joaomoreno/gulp-symdest#readme",
|
||||
"keywords": [
|
||||
"gulp",
|
||||
"dest",
|
||||
"symdest"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "gulp-symdest",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/joaomoreno/gulp-symdest.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
28
Client/node_modules/gulp-symdest/test/index.js
generated
vendored
Executable file
28
Client/node_modules/gulp-symdest/test/index.js
generated
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
var assert = require('assert');
|
||||
var symdest = require('..');
|
||||
var File = require('vinyl');
|
||||
var es = require('event-stream');
|
||||
var tmp = require('tmp');
|
||||
var fs = require('fs');
|
||||
tmp.setGracefulCleanup();
|
||||
|
||||
describe('gulp-symdest', function () {
|
||||
it('should work', function (cb) {
|
||||
var file = new File({ path: 'hello.md' });
|
||||
file.symlink = 'world.md';
|
||||
var instream = es.readArray([file]);
|
||||
|
||||
var out = tmp.dirSync().name;
|
||||
|
||||
instream
|
||||
.pipe(symdest(out))
|
||||
.pipe(es.through(null, function () {
|
||||
assert.deepEqual(fs.readdirSync(out), ['hello.md']);
|
||||
assert.throws(function () { fs.statSync(out + '/hello.md'); });
|
||||
var stat = fs.lstatSync(out + '/hello.md');
|
||||
assert(stat.isSymbolicLink());
|
||||
|
||||
cb();
|
||||
}));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user