Son CV dans un terminal web en Javascript! https://terminal-cv.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

1 year ago
"use strict";
1 year ago
Object.defineProperty(exports, "__esModule", {
value: true
});
1 year ago
var _exportNames = {
ncp: true
};
1 year ago
exports.ncp = ncp;
1 year ago
function _path() {
const data = _interopRequireDefault(require("path"));
1 year ago
_path = function () {
return data;
};
1 year ago
return data;
}
1 year ago
var _NodeFS = require("./NodeFS");
1 year ago
Object.keys(_NodeFS).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _NodeFS[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _NodeFS[key];
}
1 year ago
});
});
1 year ago
var _MemoryFS = require("./MemoryFS");
1 year ago
Object.keys(_MemoryFS).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _MemoryFS[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _MemoryFS[key];
}
1 year ago
});
});
1 year ago
var _OverlayFS = require("./OverlayFS");
1 year ago
Object.keys(_OverlayFS).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _OverlayFS[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _OverlayFS[key];
}
1 year ago
});
});
1 year ago
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1 year ago
// Recursively copies a directory from the sourceFS to the destinationFS
async function ncp(sourceFS, source, destinationFS, destination) {
await destinationFS.mkdirp(destination);
let files = await sourceFS.readdir(source);
1 year ago
for (let file of files) {
let sourcePath = _path().default.join(source, file);
1 year ago
let destPath = _path().default.join(destination, file);
1 year ago
let stats = await sourceFS.stat(sourcePath);
1 year ago
if (stats.isFile()) {
await new Promise((resolve, reject) => {
sourceFS.createReadStream(sourcePath).pipe(destinationFS.createWriteStream(destPath)).on('finish', () => resolve()).on('error', reject);
});
} else if (stats.isDirectory()) {
await ncp(sourceFS, sourcePath, destinationFS, destPath);
}
1 year ago
}
}