Merge branch 'main' of github.com:xwiki-labs/cryptpad
This commit is contained in:
commit
616a2deb23
1 changed files with 6 additions and 5 deletions
|
@ -1,18 +1,19 @@
|
|||
var prompt = require('prompt-confirm');
|
||||
const p = new prompt('Are you sure? This will permanently delete all existing data on your instance.');
|
||||
|
||||
const nThen = require("nthen");
|
||||
//const nThen = require("nthen");
|
||||
const Fs = require("fs");
|
||||
const Path = require("path");
|
||||
//const Path = require("path");
|
||||
|
||||
var config = require("../lib/load-config");
|
||||
var Hash = require('../www/common/common-hash');
|
||||
//var Hash = require('../www/common/common-hash');
|
||||
var Env = require("../lib/env").create(config);
|
||||
Env.Log = { error: console.log };
|
||||
|
||||
/*
|
||||
var keyOrDefaultString = function (key, def) {
|
||||
return Path.resolve(typeof(config[key]) === 'string'? config[key]: def);
|
||||
};
|
||||
}; */
|
||||
var paths = Env.paths;
|
||||
p.ask(function (answer) {
|
||||
if (!answer) {
|
||||
|
@ -20,7 +21,7 @@ p.ask(function (answer) {
|
|||
return;
|
||||
}
|
||||
console.log('Deleting all data...');
|
||||
var n = nThen;
|
||||
//var n = nThen;
|
||||
Object.values(paths).forEach(function (path) {
|
||||
console.log(`Deleting ${path}`);
|
||||
Fs.rmSync(path, { recursive: true, force: true });
|
||||
|
|
Loading…
Reference in a new issue