Version 0.4.0 - Ajout des metrics
All checks were successful
Neutral/pipeline/head This commit looks good

This commit is contained in:
Raphix
2023-11-28 21:05:44 +01:00
parent 04fcece8d4
commit b19243a8af
17 changed files with 1121 additions and 384 deletions

View File

@ -6,7 +6,7 @@ const clog = new LogType("Fichier")
const os = require("os");
const uuid = require('uuid');
var mime = require('mime-types');
const { set } = require("../main")
// check if shared folder exist, if not create it
if(!fs.existsSync(__glob.SHARED)) {
@ -229,4 +229,27 @@ module.exports.newFile = function(settings) {
return "EXIST"
}
}
}
module.exports.pasteFile = function(settings) {
if(settings.action == "cut") {
try {
fs.renameSync(settings.file.fileDirectory, settings.newPath + path.sep + settings.name)
return "OK"
} catch(err) {
console.log(err)
return "NOT_PERMITTED"
}
} else if(settings.action == "copy") {
try {
fs.copyFileSync(settings.file.fileDirectory, settings.newPath + path.sep + settings.name)
return "OK"
} catch(err) {
console.log(err)
return "NOT_PERMITTED"
}
}
}