From 1840c2f7c91f5f89602a3683d85b0a9df1454855 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 11 Jun 2017 15:19:43 +0200 Subject: Update webpack stack --- scripts/danger/clean/cleaner.js | 25 ------------------------- scripts/danger/clean/cleaner.ts | 25 +++++++++++++++++++++++++ scripts/danger/clean/dev.sh | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 scripts/danger/clean/cleaner.js create mode 100644 scripts/danger/clean/cleaner.ts (limited to 'scripts/danger/clean') diff --git a/scripts/danger/clean/cleaner.js b/scripts/danger/clean/cleaner.js deleted file mode 100644 index 1a1e3dee7..000000000 --- a/scripts/danger/clean/cleaner.js +++ /dev/null @@ -1,25 +0,0 @@ -const eachSeries = require('async/eachSeries') -const rimraf = require('rimraf') - -const constants = require('../../../server/initializers/constants') -const db = require('../../../server/initializers/database') - -db.init(true, function () { - db.sequelize.drop().asCallback(function (err) { - if (err) throw err - - console.info('Tables of %s deleted.', db.sequelize.config.database) - - const STORAGE = constants.CONFIG.STORAGE - eachSeries(Object.keys(STORAGE), function (storage, callbackEach) { - const storageDir = STORAGE[storage] - - rimraf(storageDir, function (err) { - console.info('%s deleted.', storageDir) - return callbackEach(err) - }) - }, function () { - process.exit(0) - }) - }) -}) diff --git a/scripts/danger/clean/cleaner.ts b/scripts/danger/clean/cleaner.ts new file mode 100644 index 000000000..d1dba4650 --- /dev/null +++ b/scripts/danger/clean/cleaner.ts @@ -0,0 +1,25 @@ +import * as eachSeries from 'async/eachSeries' +import * as rimraf from 'rimraf' + +import { CONFIG } from '../../../server/initializers/constants' +import { database as db } from '../../../server/initializers/database' + +db.init(true, function () { + db.sequelize.drop().asCallback(function (err) { + if (err) throw err + + console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME) + + const STORAGE = CONFIG.STORAGE + eachSeries(Object.keys(STORAGE), function (storage, callbackEach) { + const storageDir = STORAGE[storage] + + rimraf(storageDir, function (err) { + console.info('%s deleted.', storageDir) + return callbackEach(err) + }) + }, function () { + process.exit(0) + }) + }) +}) diff --git a/scripts/danger/clean/dev.sh b/scripts/danger/clean/dev.sh index f4a5d1e8a..270ca0a2e 100755 --- a/scripts/danger/clean/dev.sh +++ b/scripts/danger/clean/dev.sh @@ -4,5 +4,5 @@ read -p "This will remove all directories and SQL tables. Are you sure? (y/*) " echo if [[ "$REPLY" =~ ^[Yy]$ ]]; then - NODE_ENV=test node "./scripts/danger/clean/cleaner" + NODE_ENV=test npm run ts-node "./scripts/danger/clean/cleaner" fi -- cgit v1.2.3