@andersbakken/fisk 3.6.2 → 3.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,9 @@ var require$$1 = require('fs');
7
7
  var require$$0 = require('constants');
8
8
  var require$$0$1 = require('stream');
9
9
  var require$$4 = require('util');
10
- var path$i = require('path');
10
+ var path$h = require('path');
11
11
  var require$$1$1 = require('os');
12
+ var posix = require('posix');
12
13
 
13
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
15
 
@@ -19,8 +20,9 @@ var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
19
20
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
20
21
  var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
21
22
  var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
22
- var path__default = /*#__PURE__*/_interopDefaultLegacy(path$i);
23
+ var path__default = /*#__PURE__*/_interopDefaultLegacy(path$h);
23
24
  var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
25
+ var posix__default = /*#__PURE__*/_interopDefaultLegacy(posix);
24
26
 
25
27
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
26
28
 
@@ -1109,11 +1111,11 @@ function retry () {
1109
1111
  };
1110
1112
  } (fs$j));
1111
1113
 
1112
- const path$h = path__default["default"];
1114
+ const path$g = path__default["default"];
1113
1115
 
1114
1116
  // get drive on windows
1115
1117
  function getRootPath (p) {
1116
- p = path$h.normalize(path$h.resolve(p)).split(path$h.sep);
1118
+ p = path$g.normalize(path$g.resolve(p)).split(path$g.sep);
1117
1119
  if (p.length > 0) return p[0]
1118
1120
  return null
1119
1121
  }
@@ -1134,7 +1136,7 @@ var win32 = {
1134
1136
  };
1135
1137
 
1136
1138
  const fs$h = gracefulFs;
1137
- const path$g = path__default["default"];
1139
+ const path$f = path__default["default"];
1138
1140
  const invalidWin32Path$1 = win32.invalidWin32Path;
1139
1141
 
1140
1142
  const o777$1 = parseInt('0777', 8);
@@ -1162,7 +1164,7 @@ function mkdirs$2 (p, opts, callback, made) {
1162
1164
  if (!made) made = null;
1163
1165
 
1164
1166
  callback = callback || function () {};
1165
- p = path$g.resolve(p);
1167
+ p = path$f.resolve(p);
1166
1168
 
1167
1169
  xfs.mkdir(p, mode, er => {
1168
1170
  if (!er) {
@@ -1171,8 +1173,8 @@ function mkdirs$2 (p, opts, callback, made) {
1171
1173
  }
1172
1174
  switch (er.code) {
1173
1175
  case 'ENOENT':
1174
- if (path$g.dirname(p) === p) return callback(er)
1175
- mkdirs$2(path$g.dirname(p), opts, (er, made) => {
1176
+ if (path$f.dirname(p) === p) return callback(er)
1177
+ mkdirs$2(path$f.dirname(p), opts, (er, made) => {
1176
1178
  if (er) callback(er, made);
1177
1179
  else mkdirs$2(p, opts, callback, made);
1178
1180
  });
@@ -1196,7 +1198,7 @@ function mkdirs$2 (p, opts, callback, made) {
1196
1198
  var mkdirs_1$1 = mkdirs$2;
1197
1199
 
1198
1200
  const fs$g = gracefulFs;
1199
- const path$f = path__default["default"];
1201
+ const path$e = path__default["default"];
1200
1202
  const invalidWin32Path = win32.invalidWin32Path;
1201
1203
 
1202
1204
  const o777 = parseInt('0777', 8);
@@ -1220,15 +1222,15 @@ function mkdirsSync$2 (p, opts, made) {
1220
1222
  }
1221
1223
  if (!made) made = null;
1222
1224
 
1223
- p = path$f.resolve(p);
1225
+ p = path$e.resolve(p);
1224
1226
 
1225
1227
  try {
1226
1228
  xfs.mkdirSync(p, mode);
1227
1229
  made = made || p;
1228
1230
  } catch (err0) {
1229
1231
  if (err0.code === 'ENOENT') {
1230
- if (path$f.dirname(p) === p) throw err0
1231
- made = mkdirsSync$2(path$f.dirname(p), opts, made);
1232
+ if (path$e.dirname(p) === p) throw err0
1233
+ made = mkdirsSync$2(path$e.dirname(p), opts, made);
1232
1234
  mkdirsSync$2(p, opts, made);
1233
1235
  } else {
1234
1236
  // In the case of any other error, just see if there's a dir there
@@ -1264,12 +1266,12 @@ var mkdirs_1 = {
1264
1266
 
1265
1267
  const fs$f = gracefulFs;
1266
1268
  const os = require$$1__default$1["default"];
1267
- const path$e = path__default["default"];
1269
+ const path$d = path__default["default"];
1268
1270
 
1269
1271
  // HFS, ext{2,3}, FAT do not, Node.js v0.10 does not
1270
1272
  function hasMillisResSync () {
1271
- let tmpfile = path$e.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2));
1272
- tmpfile = path$e.join(os.tmpdir(), tmpfile);
1273
+ let tmpfile = path$d.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2));
1274
+ tmpfile = path$d.join(os.tmpdir(), tmpfile);
1273
1275
 
1274
1276
  // 550 millis past UNIX epoch
1275
1277
  const d = new Date(1435410243862);
@@ -1281,8 +1283,8 @@ function hasMillisResSync () {
1281
1283
  }
1282
1284
 
1283
1285
  function hasMillisRes (callback) {
1284
- let tmpfile = path$e.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2));
1285
- tmpfile = path$e.join(os.tmpdir(), tmpfile);
1286
+ let tmpfile = path$d.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2));
1287
+ tmpfile = path$d.join(os.tmpdir(), tmpfile);
1286
1288
 
1287
1289
  // 550 millis past UNIX epoch
1288
1290
  const d = new Date(1435410243862);
@@ -1353,7 +1355,7 @@ var buffer$1 = function (size) {
1353
1355
  };
1354
1356
 
1355
1357
  const fs$e = gracefulFs;
1356
- const path$d = path__default["default"];
1358
+ const path$c = path__default["default"];
1357
1359
  const mkdirpSync$1 = mkdirs_1.mkdirsSync;
1358
1360
  const utimesSync = utimes$1.utimesMillisSync;
1359
1361
 
@@ -1379,7 +1381,7 @@ function copySync$2 (src, dest, opts) {
1379
1381
 
1380
1382
  if (opts.filter && !opts.filter(src, dest)) return
1381
1383
 
1382
- const destParent = path$d.dirname(dest);
1384
+ const destParent = path$c.dirname(dest);
1383
1385
  if (!fs$e.existsSync(destParent)) mkdirpSync$1(destParent);
1384
1386
  return startCopy$1(resolvedDest, src, dest, opts)
1385
1387
  }
@@ -1480,8 +1482,8 @@ function copyDir$1 (src, dest, opts) {
1480
1482
  }
1481
1483
 
1482
1484
  function copyDirItem$1 (item, src, dest, opts) {
1483
- const srcItem = path$d.join(src, item);
1484
- const destItem = path$d.join(dest, item);
1485
+ const srcItem = path$c.join(src, item);
1486
+ const destItem = path$c.join(dest, item);
1485
1487
  const resolvedDest = checkPaths$1(srcItem, destItem);
1486
1488
  return startCopy$1(resolvedDest, srcItem, destItem, opts)
1487
1489
  }
@@ -1490,7 +1492,7 @@ function onLink$1 (resolvedDest, src, dest, opts) {
1490
1492
  let resolvedSrc = fs$e.readlinkSync(src);
1491
1493
 
1492
1494
  if (opts.dereference) {
1493
- resolvedSrc = path$d.resolve(process.cwd(), resolvedSrc);
1495
+ resolvedSrc = path$c.resolve(process.cwd(), resolvedSrc);
1494
1496
  }
1495
1497
 
1496
1498
  if (resolvedDest === notExist$1 || resolvedDest === existsReg$1) {
@@ -1499,7 +1501,7 @@ function onLink$1 (resolvedDest, src, dest, opts) {
1499
1501
  return fs$e.symlinkSync(resolvedSrc, dest)
1500
1502
  } else {
1501
1503
  if (opts.dereference) {
1502
- resolvedDest = path$d.resolve(process.cwd(), resolvedDest);
1504
+ resolvedDest = path$c.resolve(process.cwd(), resolvedDest);
1503
1505
  }
1504
1506
  if (pathsAreIdentical$1(resolvedSrc, resolvedDest)) return
1505
1507
 
@@ -1521,8 +1523,8 @@ function copyLink$1 (resolvedSrc, dest) {
1521
1523
  // return true if dest is a subdir of src, otherwise false.
1522
1524
  // extract dest base dir and check if that is the same as src basename.
1523
1525
  function isSrcSubdir$3 (src, dest) {
1524
- const srcArray = path$d.resolve(src).split(path$d.sep);
1525
- const destArray = path$d.resolve(dest).split(path$d.sep);
1526
+ const srcArray = path$c.resolve(src).split(path$c.sep);
1527
+ const destArray = path$c.resolve(dest).split(path$c.sep);
1526
1528
 
1527
1529
  return srcArray.reduce((acc, current, i) => {
1528
1530
  return acc && destArray[i] === current
@@ -1547,8 +1549,8 @@ function checkDest$1 (dest) {
1547
1549
 
1548
1550
  function pathsAreIdentical$1 (src, dest) {
1549
1551
  const os = process.platform;
1550
- const resolvedSrc = path$d.resolve(src);
1551
- const resolvedDest = path$d.resolve(dest);
1552
+ const resolvedSrc = path$c.resolve(src);
1553
+ const resolvedDest = path$c.resolve(dest);
1552
1554
  // case-insensitive paths
1553
1555
  if (os === 'darwin' || os === 'win32') {
1554
1556
  return resolvedSrc.toLowerCase() === resolvedDest.toLowerCase()
@@ -1587,7 +1589,7 @@ var pathExists_1 = {
1587
1589
  };
1588
1590
 
1589
1591
  const fs$c = gracefulFs;
1590
- const path$c = path__default["default"];
1592
+ const path$b = path__default["default"];
1591
1593
  const mkdirp$1 = mkdirs_1.mkdirs;
1592
1594
  const pathExists$7 = pathExists_1.pathExists;
1593
1595
  const utimes = utimes$1.utimesMillis;
@@ -1623,7 +1625,7 @@ function copy$2 (src, dest, opts, cb) {
1623
1625
  }
1624
1626
 
1625
1627
  function checkParentDir (resolvedDest, src, dest, opts, cb) {
1626
- const destParent = path$c.dirname(dest);
1628
+ const destParent = path$b.dirname(dest);
1627
1629
  pathExists$7(destParent, (err, dirExists) => {
1628
1630
  if (err) return cb(err)
1629
1631
  if (dirExists) return startCopy(resolvedDest, src, dest, opts, cb)
@@ -1758,8 +1760,8 @@ function copyDirItems (items, src, dest, opts, cb) {
1758
1760
  }
1759
1761
 
1760
1762
  function copyDirItem (items, item, src, dest, opts, cb) {
1761
- const srcItem = path$c.join(src, item);
1762
- const destItem = path$c.join(dest, item);
1763
+ const srcItem = path$b.join(src, item);
1764
+ const destItem = path$b.join(dest, item);
1763
1765
  checkPaths(srcItem, destItem, (err, resolvedDest) => {
1764
1766
  if (err) return cb(err)
1765
1767
  startCopy(resolvedDest, srcItem, destItem, opts, err => {
@@ -1774,7 +1776,7 @@ function onLink (resolvedDest, src, dest, opts, cb) {
1774
1776
  if (err) return cb(err)
1775
1777
 
1776
1778
  if (opts.dereference) {
1777
- resolvedSrc = path$c.resolve(process.cwd(), resolvedSrc);
1779
+ resolvedSrc = path$b.resolve(process.cwd(), resolvedSrc);
1778
1780
  }
1779
1781
 
1780
1782
  if (resolvedDest === notExist || resolvedDest === existsReg) {
@@ -1783,7 +1785,7 @@ function onLink (resolvedDest, src, dest, opts, cb) {
1783
1785
  return fs$c.symlink(resolvedSrc, dest, cb)
1784
1786
  } else {
1785
1787
  if (opts.dereference) {
1786
- resolvedDest = path$c.resolve(process.cwd(), resolvedDest);
1788
+ resolvedDest = path$b.resolve(process.cwd(), resolvedDest);
1787
1789
  }
1788
1790
  if (pathsAreIdentical(resolvedSrc, resolvedDest)) return cb()
1789
1791
 
@@ -1811,8 +1813,8 @@ function copyLink (resolvedSrc, dest, cb) {
1811
1813
  // return true if dest is a subdir of src, otherwise false.
1812
1814
  // extract dest base dir and check if that is the same as src basename.
1813
1815
  function isSrcSubdir$2 (src, dest) {
1814
- const srcArray = path$c.resolve(src).split(path$c.sep);
1815
- const destArray = path$c.resolve(dest).split(path$c.sep);
1816
+ const srcArray = path$b.resolve(src).split(path$b.sep);
1817
+ const destArray = path$b.resolve(dest).split(path$b.sep);
1816
1818
 
1817
1819
  return srcArray.reduce((acc, current, i) => {
1818
1820
  return acc && destArray[i] === current
@@ -1836,8 +1838,8 @@ function checkDest (dest, cb) {
1836
1838
 
1837
1839
  function pathsAreIdentical (src, dest) {
1838
1840
  const os = process.platform;
1839
- const resolvedSrc = path$c.resolve(src);
1840
- const resolvedDest = path$c.resolve(dest);
1841
+ const resolvedSrc = path$b.resolve(src);
1842
+ const resolvedDest = path$b.resolve(dest);
1841
1843
  // case-insensitive paths
1842
1844
  if (os === 'darwin' || os === 'win32') {
1843
1845
  return resolvedSrc.toLowerCase() === resolvedDest.toLowerCase()
@@ -1867,7 +1869,7 @@ var copy$1 = {
1867
1869
  };
1868
1870
 
1869
1871
  const fs$b = gracefulFs;
1870
- const path$b = path__default["default"];
1872
+ const path$a = path__default["default"];
1871
1873
  const assert = assert__default["default"];
1872
1874
 
1873
1875
  const isWindows = (process.platform === 'win32');
@@ -2072,7 +2074,7 @@ function rmkids (p, options, cb) {
2072
2074
  if (n === 0) return options.rmdir(p, cb)
2073
2075
 
2074
2076
  files.forEach(f => {
2075
- rimraf$1(path$b.join(p, f), options, er => {
2077
+ rimraf$1(path$a.join(p, f), options, er => {
2076
2078
  if (errState) {
2077
2079
  return
2078
2080
  }
@@ -2154,7 +2156,7 @@ function rmdirSync (p, options, originalEr) {
2154
2156
  function rmkidsSync (p, options) {
2155
2157
  assert(p);
2156
2158
  assert(options);
2157
- options.readdirSync(p).forEach(f => rimrafSync(path$b.join(p, f), options));
2159
+ options.readdirSync(p).forEach(f => rimrafSync(path$a.join(p, f), options));
2158
2160
 
2159
2161
  // We only end up here once we got ENOTEMPTY at least once, and
2160
2162
  // at this point, we are guaranteed to have removed all the kids.
@@ -2189,7 +2191,7 @@ var remove$2 = {
2189
2191
 
2190
2192
  const u$7 = universalify.fromCallback;
2191
2193
  const fs$a = require$$1__default["default"];
2192
- const path$a = path__default["default"];
2194
+ const path$9 = path__default["default"];
2193
2195
  const mkdir$5 = mkdirs_1;
2194
2196
  const remove$1 = remove$2;
2195
2197
 
@@ -2198,7 +2200,7 @@ const emptyDir = u$7(function emptyDir (dir, callback) {
2198
2200
  fs$a.readdir(dir, (err, items) => {
2199
2201
  if (err) return mkdir$5.mkdirs(dir, callback)
2200
2202
 
2201
- items = items.map(item => path$a.join(dir, item));
2203
+ items = items.map(item => path$9.join(dir, item));
2202
2204
 
2203
2205
  deleteItem();
2204
2206
 
@@ -2222,7 +2224,7 @@ function emptyDirSync (dir) {
2222
2224
  }
2223
2225
 
2224
2226
  items.forEach(item => {
2225
- item = path$a.join(dir, item);
2227
+ item = path$9.join(dir, item);
2226
2228
  remove$1.removeSync(item);
2227
2229
  });
2228
2230
  }
@@ -2235,7 +2237,7 @@ var empty = {
2235
2237
  };
2236
2238
 
2237
2239
  const u$6 = universalify.fromCallback;
2238
- const path$9 = path__default["default"];
2240
+ const path$8 = path__default["default"];
2239
2241
  const fs$9 = gracefulFs;
2240
2242
  const mkdir$4 = mkdirs_1;
2241
2243
  const pathExists$6 = pathExists_1.pathExists;
@@ -2250,7 +2252,7 @@ function createFile (file, callback) {
2250
2252
 
2251
2253
  fs$9.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
2252
2254
  if (!err && stats.isFile()) return callback()
2253
- const dir = path$9.dirname(file);
2255
+ const dir = path$8.dirname(file);
2254
2256
  pathExists$6(dir, (err, dirExists) => {
2255
2257
  if (err) return callback(err)
2256
2258
  if (dirExists) return makeFile()
@@ -2269,7 +2271,7 @@ function createFileSync (file) {
2269
2271
  } catch (e) {}
2270
2272
  if (stats && stats.isFile()) return
2271
2273
 
2272
- const dir = path$9.dirname(file);
2274
+ const dir = path$8.dirname(file);
2273
2275
  if (!fs$9.existsSync(dir)) {
2274
2276
  mkdir$4.mkdirsSync(dir);
2275
2277
  }
@@ -2283,7 +2285,7 @@ var file$1 = {
2283
2285
  };
2284
2286
 
2285
2287
  const u$5 = universalify.fromCallback;
2286
- const path$8 = path__default["default"];
2288
+ const path$7 = path__default["default"];
2287
2289
  const fs$8 = gracefulFs;
2288
2290
  const mkdir$3 = mkdirs_1;
2289
2291
  const pathExists$5 = pathExists_1.pathExists;
@@ -2305,7 +2307,7 @@ function createLink (srcpath, dstpath, callback) {
2305
2307
  return callback(err)
2306
2308
  }
2307
2309
 
2308
- const dir = path$8.dirname(dstpath);
2310
+ const dir = path$7.dirname(dstpath);
2309
2311
  pathExists$5(dir, (err, dirExists) => {
2310
2312
  if (err) return callback(err)
2311
2313
  if (dirExists) return makeLink(srcpath, dstpath)
@@ -2329,7 +2331,7 @@ function createLinkSync (srcpath, dstpath) {
2329
2331
  throw err
2330
2332
  }
2331
2333
 
2332
- const dir = path$8.dirname(dstpath);
2334
+ const dir = path$7.dirname(dstpath);
2333
2335
  const dirExists = fs$8.existsSync(dir);
2334
2336
  if (dirExists) return fs$8.linkSync(srcpath, dstpath)
2335
2337
  mkdir$3.mkdirsSync(dir);
@@ -2342,7 +2344,7 @@ var link$1 = {
2342
2344
  createLinkSync
2343
2345
  };
2344
2346
 
2345
- const path$7 = path__default["default"];
2347
+ const path$6 = path__default["default"];
2346
2348
  const fs$7 = gracefulFs;
2347
2349
  const pathExists$4 = pathExists_1.pathExists;
2348
2350
 
@@ -2369,7 +2371,7 @@ const pathExists$4 = pathExists_1.pathExists;
2369
2371
  */
2370
2372
 
2371
2373
  function symlinkPaths$1 (srcpath, dstpath, callback) {
2372
- if (path$7.isAbsolute(srcpath)) {
2374
+ if (path$6.isAbsolute(srcpath)) {
2373
2375
  return fs$7.lstat(srcpath, (err) => {
2374
2376
  if (err) {
2375
2377
  err.message = err.message.replace('lstat', 'ensureSymlink');
@@ -2381,8 +2383,8 @@ function symlinkPaths$1 (srcpath, dstpath, callback) {
2381
2383
  })
2382
2384
  })
2383
2385
  } else {
2384
- const dstdir = path$7.dirname(dstpath);
2385
- const relativeToDst = path$7.join(dstdir, srcpath);
2386
+ const dstdir = path$6.dirname(dstpath);
2387
+ const relativeToDst = path$6.join(dstdir, srcpath);
2386
2388
  return pathExists$4(relativeToDst, (err, exists) => {
2387
2389
  if (err) return callback(err)
2388
2390
  if (exists) {
@@ -2398,7 +2400,7 @@ function symlinkPaths$1 (srcpath, dstpath, callback) {
2398
2400
  }
2399
2401
  return callback(null, {
2400
2402
  'toCwd': srcpath,
2401
- 'toDst': path$7.relative(dstdir, srcpath)
2403
+ 'toDst': path$6.relative(dstdir, srcpath)
2402
2404
  })
2403
2405
  })
2404
2406
  }
@@ -2408,7 +2410,7 @@ function symlinkPaths$1 (srcpath, dstpath, callback) {
2408
2410
 
2409
2411
  function symlinkPathsSync$1 (srcpath, dstpath) {
2410
2412
  let exists;
2411
- if (path$7.isAbsolute(srcpath)) {
2413
+ if (path$6.isAbsolute(srcpath)) {
2412
2414
  exists = fs$7.existsSync(srcpath);
2413
2415
  if (!exists) throw new Error('absolute srcpath does not exist')
2414
2416
  return {
@@ -2416,8 +2418,8 @@ function symlinkPathsSync$1 (srcpath, dstpath) {
2416
2418
  'toDst': srcpath
2417
2419
  }
2418
2420
  } else {
2419
- const dstdir = path$7.dirname(dstpath);
2420
- const relativeToDst = path$7.join(dstdir, srcpath);
2421
+ const dstdir = path$6.dirname(dstpath);
2422
+ const relativeToDst = path$6.join(dstdir, srcpath);
2421
2423
  exists = fs$7.existsSync(relativeToDst);
2422
2424
  if (exists) {
2423
2425
  return {
@@ -2429,7 +2431,7 @@ function symlinkPathsSync$1 (srcpath, dstpath) {
2429
2431
  if (!exists) throw new Error('relative srcpath does not exist')
2430
2432
  return {
2431
2433
  'toCwd': srcpath,
2432
- 'toDst': path$7.relative(dstdir, srcpath)
2434
+ 'toDst': path$6.relative(dstdir, srcpath)
2433
2435
  }
2434
2436
  }
2435
2437
  }
@@ -2471,7 +2473,7 @@ var symlinkType_1 = {
2471
2473
  };
2472
2474
 
2473
2475
  const u$4 = universalify.fromCallback;
2474
- const path$6 = path__default["default"];
2476
+ const path$5 = path__default["default"];
2475
2477
  const fs$5 = gracefulFs;
2476
2478
  const _mkdirs = mkdirs_1;
2477
2479
  const mkdirs = _mkdirs.mkdirs;
@@ -2499,7 +2501,7 @@ function createSymlink (srcpath, dstpath, type, callback) {
2499
2501
  srcpath = relative.toDst;
2500
2502
  symlinkType(relative.toCwd, type, (err, type) => {
2501
2503
  if (err) return callback(err)
2502
- const dir = path$6.dirname(dstpath);
2504
+ const dir = path$5.dirname(dstpath);
2503
2505
  pathExists$3(dir, (err, dirExists) => {
2504
2506
  if (err) return callback(err)
2505
2507
  if (dirExists) return fs$5.symlink(srcpath, dstpath, type, callback)
@@ -2520,7 +2522,7 @@ function createSymlinkSync (srcpath, dstpath, type) {
2520
2522
  const relative = symlinkPathsSync(srcpath, dstpath);
2521
2523
  srcpath = relative.toDst;
2522
2524
  type = symlinkTypeSync(relative.toCwd, type);
2523
- const dir = path$6.dirname(dstpath);
2525
+ const dir = path$5.dirname(dstpath);
2524
2526
  const exists = fs$5.existsSync(dir);
2525
2527
  if (exists) return fs$5.symlinkSync(srcpath, dstpath, type)
2526
2528
  mkdirsSync(dir);
@@ -2700,7 +2702,7 @@ var jsonfile = {
2700
2702
  writeJsonSync: jsonFile$3.writeFileSync
2701
2703
  };
2702
2704
 
2703
- const path$5 = path__default["default"];
2705
+ const path$4 = path__default["default"];
2704
2706
  const mkdir$2 = mkdirs_1;
2705
2707
  const pathExists$2 = pathExists_1.pathExists;
2706
2708
  const jsonFile$2 = jsonfile;
@@ -2711,7 +2713,7 @@ function outputJson (file, data, options, callback) {
2711
2713
  options = {};
2712
2714
  }
2713
2715
 
2714
- const dir = path$5.dirname(file);
2716
+ const dir = path$4.dirname(file);
2715
2717
 
2716
2718
  pathExists$2(dir, (err, itDoes) => {
2717
2719
  if (err) return callback(err)
@@ -2727,12 +2729,12 @@ function outputJson (file, data, options, callback) {
2727
2729
  var outputJson_1 = outputJson;
2728
2730
 
2729
2731
  const fs$4 = gracefulFs;
2730
- const path$4 = path__default["default"];
2732
+ const path$3 = path__default["default"];
2731
2733
  const mkdir$1 = mkdirs_1;
2732
2734
  const jsonFile$1 = jsonfile;
2733
2735
 
2734
2736
  function outputJsonSync (file, data, options) {
2735
- const dir = path$4.dirname(file);
2737
+ const dir = path$3.dirname(file);
2736
2738
 
2737
2739
  if (!fs$4.existsSync(dir)) {
2738
2740
  mkdir$1.mkdirsSync(dir);
@@ -2759,7 +2761,7 @@ jsonFile.readJSONSync = jsonFile.readJsonSync;
2759
2761
  var json = jsonFile;
2760
2762
 
2761
2763
  const fs$3 = gracefulFs;
2762
- const path$3 = path__default["default"];
2764
+ const path$2 = path__default["default"];
2763
2765
  const copySync = copySync$1.copySync;
2764
2766
  const removeSync = remove$2.removeSync;
2765
2767
  const mkdirpSync = mkdirs_1.mkdirsSync;
@@ -2769,14 +2771,14 @@ function moveSync (src, dest, options) {
2769
2771
  options = options || {};
2770
2772
  const overwrite = options.overwrite || options.clobber || false;
2771
2773
 
2772
- src = path$3.resolve(src);
2773
- dest = path$3.resolve(dest);
2774
+ src = path$2.resolve(src);
2775
+ dest = path$2.resolve(dest);
2774
2776
 
2775
2777
  if (src === dest) return fs$3.accessSync(src)
2776
2778
 
2777
2779
  if (isSrcSubdir$1(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`)
2778
2780
 
2779
- mkdirpSync(path$3.dirname(dest));
2781
+ mkdirpSync(path$2.dirname(dest));
2780
2782
  tryRenameSync();
2781
2783
 
2782
2784
  function tryRenameSync () {
@@ -2864,7 +2866,7 @@ function isSrcSubdir$1 (src, dest) {
2864
2866
  return fs$3.statSync(src).isDirectory() &&
2865
2867
  src !== dest &&
2866
2868
  dest.indexOf(src) > -1 &&
2867
- dest.split(path$3.dirname(src) + path$3.sep)[1].split(path$3.sep)[0] === path$3.basename(src)
2869
+ dest.split(path$2.dirname(src) + path$2.sep)[1].split(path$2.sep)[0] === path$2.basename(src)
2868
2870
  } catch (e) {
2869
2871
  return false
2870
2872
  }
@@ -2876,7 +2878,7 @@ var moveSync_1 = {
2876
2878
 
2877
2879
  const u$1 = universalify.fromCallback;
2878
2880
  const fs$2 = gracefulFs;
2879
- const path$2 = path__default["default"];
2881
+ const path$1 = path__default["default"];
2880
2882
  const copy = copy$1.copy;
2881
2883
  const remove = remove$2.remove;
2882
2884
  const mkdirp = mkdirs_1.mkdirp;
@@ -2890,8 +2892,8 @@ function move (src, dest, opts, cb) {
2890
2892
 
2891
2893
  const overwrite = opts.overwrite || opts.clobber || false;
2892
2894
 
2893
- src = path$2.resolve(src);
2894
- dest = path$2.resolve(dest);
2895
+ src = path$1.resolve(src);
2896
+ dest = path$1.resolve(dest);
2895
2897
 
2896
2898
  if (src === dest) return fs$2.access(src, cb)
2897
2899
 
@@ -2901,7 +2903,7 @@ function move (src, dest, opts, cb) {
2901
2903
  if (st.isDirectory() && isSrcSubdir(src, dest)) {
2902
2904
  return cb(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`))
2903
2905
  }
2904
- mkdirp(path$2.dirname(dest), err => {
2906
+ mkdirp(path$1.dirname(dest), err => {
2905
2907
  if (err) return cb(err)
2906
2908
  return doRename(src, dest, overwrite, cb)
2907
2909
  });
@@ -2943,8 +2945,8 @@ function moveAcrossDevice (src, dest, overwrite, cb) {
2943
2945
  }
2944
2946
 
2945
2947
  function isSrcSubdir (src, dest) {
2946
- const srcArray = src.split(path$2.sep);
2947
- const destArray = dest.split(path$2.sep);
2948
+ const srcArray = src.split(path$1.sep);
2949
+ const destArray = dest.split(path$1.sep);
2948
2950
 
2949
2951
  return srcArray.reduce((acc, current, i) => {
2950
2952
  return acc && destArray[i] === current
@@ -2957,7 +2959,7 @@ var move_1 = {
2957
2959
 
2958
2960
  const u = universalify.fromCallback;
2959
2961
  const fs$1 = gracefulFs;
2960
- const path$1 = path__default["default"];
2962
+ const path = path__default["default"];
2961
2963
  const mkdir = mkdirs_1;
2962
2964
  const pathExists = pathExists_1.pathExists;
2963
2965
 
@@ -2967,7 +2969,7 @@ function outputFile (file, data, encoding, callback) {
2967
2969
  encoding = 'utf8';
2968
2970
  }
2969
2971
 
2970
- const dir = path$1.dirname(file);
2972
+ const dir = path.dirname(file);
2971
2973
  pathExists(dir, (err, itDoes) => {
2972
2974
  if (err) return callback(err)
2973
2975
  if (itDoes) return fs$1.writeFile(file, data, encoding, callback)
@@ -2981,7 +2983,7 @@ function outputFile (file, data, encoding, callback) {
2981
2983
  }
2982
2984
 
2983
2985
  function outputFileSync (file, ...args) {
2984
- const dir = path$1.dirname(file);
2986
+ const dir = path.dirname(file);
2985
2987
  if (fs$1.existsSync(dir)) {
2986
2988
  return fs$1.writeFileSync(file, ...args)
2987
2989
  }
@@ -3562,168 +3564,6 @@ function isConstructorOrProto (obj, key) {
3562
3564
  return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
3563
3565
  }
3564
3566
 
3565
- var posixExports = {};
3566
- var posix$1 = {
3567
- get exports(){ return posixExports; },
3568
- set exports(v){ posixExports = v; },
3569
- };
3570
-
3571
- var path = path__default["default"];
3572
-
3573
-
3574
- var IS_LINUX = require$$1__default$1["default"].platform() === 'linux';
3575
-
3576
-
3577
- // Attempt to load the bindings module from various possible locations
3578
- function load_extension() {
3579
- var ext_dirs = [
3580
- 'build/bindings', 'build/Release', 'out/Release', 'Release',
3581
- 'build/Debug', 'out/Debug',
3582
- ], i;
3583
- for (i in ext_dirs) {
3584
- try {
3585
- return require(path.join(__dirname, '../..', ext_dirs[i],
3586
- 'posix.node'));
3587
-
3588
- } catch (error) {
3589
- if (!/Cannot find module/.test(error.message)) {
3590
- throw error;
3591
- }
3592
- }
3593
- }
3594
- throw new Error("unable to load the node-posix extension module");
3595
- }
3596
-
3597
- var posix = load_extension();
3598
-
3599
- var syslog_constants = {};
3600
- posix.update_syslog_constants(syslog_constants);
3601
-
3602
- function syslog_const(value) {
3603
- if (syslog_constants[value] === undefined) {
3604
- throw new Error("invalid syslog constant value: " + value);
3605
- }
3606
-
3607
- return syslog_constants[value];
3608
- }
3609
-
3610
- function syslog_flags(option, prefix) {
3611
- prefix = prefix || "";
3612
- var opt = 0, key, flag;
3613
- for (key in option) {
3614
- flag = syslog_const(prefix + key); // checks all flags
3615
- opt |= option[key] ? flag : 0;
3616
- }
3617
- return opt;
3618
- }
3619
-
3620
- posix$1.exports = {
3621
- getgid: process.getgid,
3622
- getuid: process.getuid,
3623
- setgid: process.setgid,
3624
- setuid: process.setuid,
3625
-
3626
- chroot: posix.chroot,
3627
- closelog: posix.closelog,
3628
- getegid: posix.getegid,
3629
- geteuid: posix.geteuid,
3630
- getgrnam: posix.getgrnam,
3631
- getpgid: posix.getpgid,
3632
- setpgid: posix.setpgid,
3633
- getppid: posix.getppid,
3634
- getpwnam: posix.getpwnam,
3635
- getrlimit: posix.getrlimit,
3636
- setrlimit: posix.setrlimit,
3637
- setsid: posix.setsid,
3638
-
3639
- openlog: function (ident, option, facility) {
3640
- return posix.openlog(ident, syslog_flags(option),
3641
- syslog_const(facility));
3642
- },
3643
-
3644
- syslog: function (priority, message) {
3645
- return posix.syslog(syslog_const(priority), message);
3646
- },
3647
-
3648
- setlogmask: function (maskpri) {
3649
- var bits = posix.setlogmask(syslog_flags(maskpri, "mask_")), flags = {}, key;
3650
- for (key in syslog_constants) {
3651
- if (key.match("^mask_")) {
3652
- flags[key.substr(5, 10)] = (bits & syslog_constants[key])
3653
- ? true : false;
3654
- }
3655
- }
3656
- return flags;
3657
- },
3658
-
3659
- // http://pubs.opengroup.org/onlinepubs/007904875/functions/getpgrp.html
3660
- getpgrp: function () {
3661
- return posix.getpgid(0);
3662
- },
3663
-
3664
- seteuid: function (euid) {
3665
- euid = (typeof (euid) === 'string') ? posix.getpwnam(euid).uid : euid;
3666
- return posix.seteuid(euid);
3667
- },
3668
-
3669
- setreuid: function (ruid, euid) {
3670
- ruid = (typeof (ruid) === 'string') ? posix.getpwnam(ruid).uid : ruid;
3671
- euid = (typeof (euid) === 'string') ? posix.getpwnam(euid).uid : euid;
3672
- return posix.setreuid(ruid, euid);
3673
- },
3674
-
3675
- setegid: function (egid) {
3676
- egid = (typeof (egid) === 'string') ? posix.getgrnam(egid).gid : egid;
3677
- return posix.setegid(egid);
3678
- },
3679
-
3680
- setregid: function (rgid, egid) {
3681
- rgid = (typeof (rgid) === 'string') ? posix.getgrnam(rgid).gid : rgid;
3682
- egid = (typeof (egid) === 'string') ? posix.getgrnam(egid).gid : egid;
3683
- return posix.setregid(rgid, egid);
3684
- },
3685
-
3686
- gethostname: posix.gethostname,
3687
- sethostname: posix.sethostname,
3688
- };
3689
-
3690
- var swap_constants = {};
3691
-
3692
- function swap_const(value) {
3693
- var constant = swap_constants[value];
3694
- if (constant === undefined) {
3695
- throw "invalid swap constant value: " + value;
3696
- }
3697
-
3698
- return constant;
3699
- }
3700
-
3701
- function swap_flags(option) {
3702
- var opt = 0, key, flag;
3703
- for (key in option) {
3704
- flag = swap_const(key); // checks all flags
3705
- opt |= option[key] ? flag : 0;
3706
- }
3707
- return opt;
3708
- }
3709
-
3710
-
3711
- if (IS_LINUX) {
3712
- posix.update_swap_constants(swap_constants);
3713
- posixExports.swapon = function (path, swapflags) {
3714
- return posix.swapon(path, swap_flags(swapflags));
3715
- };
3716
- posixExports.swapoff = posix.swapoff;
3717
- }
3718
-
3719
- if ('initgroups' in posix) {
3720
- // initgroups is in SVr4 and 4.3BSD, not POSIX
3721
- posixExports.initgroups = function (user, group) {
3722
- var gid = (typeof (group) === 'string') ? posix.getgrnam(group).gid : group;
3723
- return posix.initgroups(user, gid);
3724
- };
3725
- }
3726
-
3727
3567
  const argv = minimist(process.argv.slice(2));
3728
3568
  function send(message) {
3729
3569
  try {
@@ -3746,7 +3586,7 @@ process.on("uncaughtException", (err) => {
3746
3586
  let pwd;
3747
3587
  if (argv.user) {
3748
3588
  try {
3749
- pwd = posixExports.getpwnam(argv.user);
3589
+ pwd = posix__default["default"].getpwnam(argv.user);
3750
3590
  }
3751
3591
  catch (err) {
3752
3592
  console.error("Couldn't find user", argv.user);
@@ -3761,7 +3601,7 @@ if (argv.user) {
3761
3601
  }
3762
3602
  try {
3763
3603
  console.log("Chrooting to", argv.root);
3764
- posixExports.chroot(argv.root);
3604
+ posix__default["default"].chroot(argv.root);
3765
3605
  }
3766
3606
  catch (err) {
3767
3607
  console.error("Changing root or user failed", err);