mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved simple server backup.
This commit is contained in:
parent
40eac9b188
commit
a934d723b9
4 changed files with 13 additions and 12 deletions
|
@ -1603,11 +1603,16 @@ function CreateMeshCentralServer(config, args) {
|
|||
// An entry's fileName implicitly requires its parent directories to exist.
|
||||
zipfile.readEntry();
|
||||
} else {
|
||||
// file entry
|
||||
// File entry
|
||||
zipfile.openReadStream(entry, function (err, readStream) {
|
||||
if (err) throw err;
|
||||
readStream.on('end', function () { zipfile.readEntry(); });
|
||||
// console.log('Extracting:', obj.getConfigFilePath(entry.fileName));
|
||||
var directory = obj.path.dirname(entry.fileName);
|
||||
if (directory != '.') {
|
||||
directory = obj.getConfigFilePath(directory)
|
||||
if (obj.fs.existsSync(directory) == false) { obj.fs.mkdirSync(directory); }
|
||||
}
|
||||
//console.log('Extracting:', obj.getConfigFilePath(entry.fileName));
|
||||
readStream.pipe(obj.fs.createWriteStream(obj.getConfigFilePath(entry.fileName)));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue