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

2 years ago
"use strict";
2 years ago
Object.defineProperty(exports, "__esModule", {
value: true
});
2 years ago
var _exportNames = {
ncp: true
};
2 years ago
exports.ncp = ncp;
2 years ago
function _path() {
const data = _interopRequireDefault(require("path"));
2 years ago
_path = function () {
return data;
};
2 years ago
return data;
}
2 years ago
var _NodeFS = require("./NodeFS");
2 years 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];
}
2 years ago
});
});
2 years ago
var _MemoryFS = require("./MemoryFS");
2 years 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];
}
2 years ago
});
});
2 years ago
var _OverlayFS = require("./OverlayFS");
2 years 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];
}
2 years ago
});
});
2 years ago
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2 years 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);
2 years ago
for (let file of files) {
let sourcePath = _path().default.join(source, file);
2 years ago
let destPath = _path().default.join(destination, file);
2 years ago
let stats = await sourceFS.stat(sourcePath);
2 years 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);
}
2 years ago
}
}