]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/danger/clean/cleaner.js
Server: correctly sort tags by name asc
[github/Chocobozzz/PeerTube.git] / scripts / danger / clean / cleaner.js
CommitLineData
82221ac9 1const rimraf = require('rimraf')
82221ac9
C
2
3const constants = require('../../../server/initializers/constants')
dd601993 4const db = require('../../../server/initializers/database')
82221ac9 5
dd601993
C
6db.init(true, function () {
7 db.sequelize.drop().asCallback(function (err) {
8 if (err) throw err
82221ac9 9
dd601993 10 console.info('Tables of %s deleted.', db.sequelize.config.database)
82221ac9 11
dd601993
C
12 const STORAGE = constants.CONFIG.STORAGE
13 Object.keys(STORAGE).forEach(function (storage) {
14 const storageDir = STORAGE[storage]
15
16 rimraf(storageDir, function (err) {
17 if (err) throw err
82221ac9 18
dd601993
C
19 console.info('Deleting %s.', storageDir)
20 })
21 })
82221ac9
C
22 })
23})