diff --git a/package.json b/package.json index 81dd622b..3adc6f9f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node server.js", - "wipe": "node wipe.js" + "wipe": "node reset.js && gulp" }, "author": "", "license": "ISC" diff --git a/wipe.js b/wipe.js index 3166ce45..74687cdb 100644 --- a/wipe.js +++ b/wipe.js @@ -101,11 +101,21 @@ const Mongo = require(__dirname+'/db/db.js') }); await readdir('uploads/img/').then(async files => { await Promise.all(files.map(async file => { - if (file != 'spoiler.png') - unlink(path.join('uploads/img/', file)); + unlink(path.join('uploads/img/', file)); + })) + }); + await readdir('uploads/captcha/').then(async files => { + await Promise.all(files.map(async file => { + unlink(path.join('uploads/captcha/', file)); + })) + }); + await readdir('uploads/banner/').then(async files => { + await Promise.all(files.map(async file => { + unlink(path.join('uploads/banner/', file)); })) }); console.log('creating admin account: admin:changeme'); await Accounts.insertOne('admin', 'changeme', 3); console.log('done'); + process.exit(0); })();