mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-21 13:34:46 +00:00
.
This commit is contained in:
parent
a004f0ae58
commit
fc725ba36b
7280 changed files with 19 additions and 1796407 deletions
32
node_modules/mkdirp/test/umask_sync.js
generated
vendored
32
node_modules/mkdirp/test/umask_sync.js
generated
vendored
|
@ -1,32 +0,0 @@
|
|||
var mkdirp = require('../');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var exists = fs.exists || path.exists;
|
||||
var test = require('tap').test;
|
||||
var _0777 = parseInt('0777', 8);
|
||||
var _0755 = parseInt('0755', 8);
|
||||
|
||||
test('umask sync modes', function (t) {
|
||||
t.plan(4);
|
||||
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 {
|
||||
mkdirp.sync(file);
|
||||
} catch (err) {
|
||||
t.fail(err);
|
||||
return t.end();
|
||||
}
|
||||
|
||||
exists(file, function (ex) {
|
||||
t.ok(ex, 'file created');
|
||||
fs.stat(file, function (err, stat) {
|
||||
t.ifError(err);
|
||||
t.equal(stat.mode & _0777, (_0777 & (~process.umask())));
|
||||
t.ok(stat.isDirectory(), 'target not a directory');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue