mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Remove deprecated script dependency
This commit is contained in:
parent
2f1ec7e4c8
commit
1e0b400878
1368
package-lock.json
generated
1368
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -51,7 +51,6 @@
|
||||
"open-sans-fontface": "^1.4.0",
|
||||
"openid-client": "^5.7.1",
|
||||
"pako": "^2.1.0",
|
||||
"prompt-confirm": "^2.0.4",
|
||||
"pull-stream": "^3.6.1",
|
||||
"require-css": "0.1.10",
|
||||
"requirejs": "2.3.7",
|
||||
|
||||
@ -2,26 +2,37 @@
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
var prompt = require('prompt-confirm');
|
||||
const p = new prompt('Are you sure? This will permanently delete all existing data on your instance.');
|
||||
|
||||
const Fs = require("fs");
|
||||
const readline = require("node:readline");
|
||||
const inter = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
var config = require("../lib/load-config");
|
||||
var Env = require("../lib/env").create(config);
|
||||
Env.Log = { error: console.log };
|
||||
|
||||
var paths = Env.paths;
|
||||
p.ask(function (answer) {
|
||||
if (!answer) {
|
||||
|
||||
const q = 'This will permanently delete all existing data on your instance. Are you sure (y/n)? ';
|
||||
inter.question(q, response => {
|
||||
let msg = response.toLowerCase().trim();
|
||||
if (!['y', 'yes'].includes(msg)) {
|
||||
console.log('Abort');
|
||||
inter.close();
|
||||
process.exit();
|
||||
return;
|
||||
}
|
||||
console.log('Deleting all data...');
|
||||
|
||||
Object.values(paths).forEach(function (path) {
|
||||
console.log(`Deleting ${path}`);
|
||||
Fs.rmSync(path, { recursive: true, force: true });
|
||||
console.log('Deleted');
|
||||
});
|
||||
console.log('Success');
|
||||
|
||||
inter.close();
|
||||
process.exit();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user