mirror of
https://github.com/S2-/gitlit
synced 2025-08-04 05:10:05 +02:00
add node modules to repo
This commit is contained in:
1
node_modules/mkpath/.npmignore
generated
vendored
Normal file
1
node_modules/mkpath/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
npm-debug.log
|
7
node_modules/mkpath/LICENSE
generated
vendored
Normal file
7
node_modules/mkpath/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (C) 2012 Jonathan Rajavuori
|
||||
|
||||
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.
|
27
node_modules/mkpath/README.md
generated
vendored
Normal file
27
node_modules/mkpath/README.md
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# mkpath
|
||||
|
||||
Make all directories in a path, like `mkdir -p`.
|
||||
|
||||
## How to use
|
||||
|
||||
var mkpath = require('mkpath');
|
||||
|
||||
mkpath('red/green/violet', function (err) {
|
||||
if (err) throw err;
|
||||
console.log('Directory structure red/green/violet created');
|
||||
});
|
||||
|
||||
mkpath.sync('/tmp/blue/orange', 0700);
|
||||
|
||||
### mkpath(path, [mode = 0777 & (~process.umask()),] [callback])
|
||||
|
||||
Create all directories that don't exist in `path` with permissions `mode`. When finished, `callback(err)` fires with the error, if any.
|
||||
|
||||
### mkpath.sync(path, [mode = 0777 & (~process.umask())]);
|
||||
|
||||
Synchronous version of the same. Throws error, if any.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the [MIT license](http://www.opensource.org/licenses/MIT).
|
||||
|
59
node_modules/mkpath/mkpath.js
generated
vendored
Normal file
59
node_modules/mkpath/mkpath.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var mkpath = function mkpath(dirpath, mode, callback) {
|
||||
dirpath = path.resolve(dirpath);
|
||||
|
||||
if (typeof mode === 'function' || typeof mode === 'undefined') {
|
||||
callback = mode;
|
||||
mode = 0777 & (~process.umask());
|
||||
}
|
||||
|
||||
if (!callback) {
|
||||
callback = function () {};
|
||||
}
|
||||
|
||||
fs.stat(dirpath, function (err, stats) {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
mkpath(path.dirname(dirpath), mode, function (err) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
} else {
|
||||
fs.mkdir(dirpath, mode, callback);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback(err);
|
||||
}
|
||||
} else if (stats.isDirectory()) {
|
||||
callback(null);
|
||||
} else {
|
||||
callback(new Error(dirpath + ' exists and is not a directory'));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
mkpath.sync = function mkpathsync(dirpath, mode) {
|
||||
dirpath = path.resolve(dirpath);
|
||||
|
||||
if (typeof mode === 'undefined') {
|
||||
mode = 0777 & (~process.umask());
|
||||
}
|
||||
|
||||
try {
|
||||
if (!fs.statSync(dirpath).isDirectory()) {
|
||||
throw new Error(dirpath + ' exists and is not a directory');
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
mkpathsync(path.dirname(dirpath), mode);
|
||||
fs.mkdirSync(dirpath, mode);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = mkpath;
|
||||
|
61
node_modules/mkpath/package.json
generated
vendored
Normal file
61
node_modules/mkpath/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"mkpath@0.1.0",
|
||||
"/home/s2/Documents/Code/gitlit"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "mkpath@0.1.0",
|
||||
"_id": "mkpath@0.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-dVSm+Nhxg0zJe1RisSLEwSTW3pE=",
|
||||
"_location": "/mkpath",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "mkpath@0.1.0",
|
||||
"name": "mkpath",
|
||||
"escapedName": "mkpath",
|
||||
"rawSpec": "0.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress-zip"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz",
|
||||
"_spec": "0.1.0",
|
||||
"_where": "/home/s2/Documents/Code/gitlit",
|
||||
"author": {
|
||||
"name": "Jonathan Rajavuori",
|
||||
"email": "jrajav@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jrajav/mkpath/issues"
|
||||
},
|
||||
"description": "Make all directories in a path, like mkdir -p",
|
||||
"devDependencies": {
|
||||
"tap": "~0.3"
|
||||
},
|
||||
"homepage": "https://github.com/jrajav/mkpath#readme",
|
||||
"keywords": [
|
||||
"mkdir",
|
||||
"mkdirp",
|
||||
"directory",
|
||||
"path",
|
||||
"tree"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./mkpath",
|
||||
"name": "mkpath",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jrajav/mkpath.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node node_modules/tap/bin/tap.js ./test"
|
||||
},
|
||||
"version": "0.1.0"
|
||||
}
|
42
node_modules/mkpath/test/chmod.js
generated
vendored
Normal file
42
node_modules/mkpath/test/chmod.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
var ps = [ '', 'tmp' ];
|
||||
|
||||
for (var i = 0; i < 25; i++) {
|
||||
var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
ps.push(dir);
|
||||
}
|
||||
|
||||
var file = ps.join('/');
|
||||
|
||||
test('chmod-pre', function (t) {
|
||||
var mode = 0744
|
||||
mkpath(file, mode, function (er) {
|
||||
t.ifError(er, 'should not error');
|
||||
fs.stat(file, function (er, stat) {
|
||||
t.ifError(er, 'should exist');
|
||||
t.ok(stat && stat.isDirectory(), 'should be directory');
|
||||
t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('chmod', function (t) {
|
||||
var mode = 0755
|
||||
mkpath(file, mode, function (er) {
|
||||
t.ifError(er, 'should not error');
|
||||
fs.stat(file, function (er, stat) {
|
||||
t.ifError(er, 'should exist');
|
||||
t.ok(stat && stat.isDirectory(), 'should be directory');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
41
node_modules/mkpath/test/clobber.js
generated
vendored
Normal file
41
node_modules/mkpath/test/clobber.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
var ps = [ '', 'tmp' ];
|
||||
|
||||
for (var i = 0; i < 25; i++) {
|
||||
var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
ps.push(dir);
|
||||
}
|
||||
|
||||
var file = ps.join('/');
|
||||
|
||||
// a file in the way
|
||||
var itw = ps.slice(0, 3).join('/');
|
||||
|
||||
|
||||
test('clobber-pre', function (t) {
|
||||
console.error("about to write to "+itw)
|
||||
fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
|
||||
|
||||
fs.stat(itw, function (er, stat) {
|
||||
t.ifError(er)
|
||||
t.ok(stat && stat.isFile(), 'should be file')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
test('clobber', function (t) {
|
||||
t.plan(2);
|
||||
mkpath(file, 0755, function (err) {
|
||||
t.ok(err);
|
||||
t.equal(err.code, 'ENOTDIR');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
32
node_modules/mkpath/test/mkpath.js
generated
vendored
Normal file
32
node_modules/mkpath/test/mkpath.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('woo', function (t) {
|
||||
t.plan(2);
|
||||
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
|
||||
var file = '/tmp/' + [x,y,z].join('/');
|
||||
|
||||
mkpath(file, 0755, function (err) {
|
||||
if (err) t.fail(err);
|
||||
else path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, 0755);
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
36
node_modules/mkpath/test/perm.js
generated
vendored
Normal file
36
node_modules/mkpath/test/perm.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('async perm', function (t) {
|
||||
t.plan(2);
|
||||
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
|
||||
|
||||
mkpath(file, 0755, function (err) {
|
||||
if (err) t.fail(err);
|
||||
else path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, 0755);
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
test('async root perm', function (t) {
|
||||
mkpath('/tmp', 0755, function (err) {
|
||||
if (err) t.fail(err);
|
||||
t.end();
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
|
43
node_modules/mkpath/test/perm_sync.js
generated
vendored
Normal file
43
node_modules/mkpath/test/perm_sync.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('sync perm', function (t) {
|
||||
t.plan(2);
|
||||
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
|
||||
|
||||
mkpath.sync(file, 0755);
|
||||
path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, 0755);
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
test('sync root perm', function (t) {
|
||||
t.plan(1);
|
||||
|
||||
var file = '/tmp';
|
||||
mkpath.sync(file, 0755);
|
||||
path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
36
node_modules/mkpath/test/rel.js
generated
vendored
Normal file
36
node_modules/mkpath/test/rel.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('rel', function (t) {
|
||||
t.plan(2);
|
||||
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
|
||||
var cwd = process.cwd();
|
||||
process.chdir('/tmp');
|
||||
|
||||
var file = [x,y,z].join('/');
|
||||
|
||||
mkpath(file, 0755, function (err) {
|
||||
if (err) t.fail(err);
|
||||
else path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
process.chdir(cwd);
|
||||
t.equal(stat.mode & 0777, 0755);
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
22
node_modules/mkpath/test/root.js
generated
vendored
Normal file
22
node_modules/mkpath/test/root.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('root', function (t) {
|
||||
// '/' on unix, 'c:/' on windows.
|
||||
var file = path.resolve('/');
|
||||
|
||||
mkpath(file, 0755, function (err) {
|
||||
if (err) throw err
|
||||
fs.stat(file, function (er, stat) {
|
||||
if (er) throw er
|
||||
t.ok(stat.isDirectory(), 'target is a directory');
|
||||
t.end();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
36
node_modules/mkpath/test/sync.js
generated
vendored
Normal file
36
node_modules/mkpath/test/sync.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('sync', function (t) {
|
||||
t.plan(2);
|
||||
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
|
||||
var file = '/tmp/' + [x,y,z].join('/');
|
||||
|
||||
try {
|
||||
mkpath.sync(file, 0755);
|
||||
} catch (err) {
|
||||
t.fail(err);
|
||||
return t.end();
|
||||
}
|
||||
|
||||
path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, 0755);
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
32
node_modules/mkpath/test/umask.js
generated
vendored
Normal file
32
node_modules/mkpath/test/umask.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('implicit mode from umask', function (t) {
|
||||
t.plan(2);
|
||||
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
|
||||
var file = '/tmp/' + [x,y,z].join('/');
|
||||
|
||||
mkpath(file, function (err) {
|
||||
if (err) t.fail(err);
|
||||
else path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, 0777 & (~process.umask()));
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
36
node_modules/mkpath/test/umask_sync.js
generated
vendored
Normal file
36
node_modules/mkpath/test/umask_sync.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Tests borrowed from substack's node-mkdirp
|
||||
* https://github.com/substack/node-mkdirp */
|
||||
|
||||
var mkpath = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('umask sync modes', function (t) {
|
||||
t.plan(2);
|
||||
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
||||
|
||||
var file = '/tmp/' + [x,y,z].join('/');
|
||||
|
||||
try {
|
||||
mkpath.sync(file);
|
||||
} catch (err) {
|
||||
t.fail(err);
|
||||
return t.end();
|
||||
}
|
||||
|
||||
path.exists(file, function (ex) {
|
||||
if (!ex) t.fail('file not created')
|
||||
else fs.stat(file, function (err, stat) {
|
||||
if (err) t.fail(err)
|
||||
else {
|
||||
t.equal(stat.mode & 0777, (0777 & (~process.umask())));
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
t.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user