diff options
Diffstat (limited to 'scripts/danger/clean')
-rw-r--r-- | scripts/danger/clean/cleaner.ts | 34 | ||||
-rwxr-xr-x | scripts/danger/clean/dev.sh | 10 | ||||
-rwxr-xr-x | scripts/danger/clean/modules.sh | 9 | ||||
-rwxr-xr-x | scripts/danger/clean/prod.sh | 10 |
4 files changed, 0 insertions, 63 deletions
diff --git a/scripts/danger/clean/cleaner.ts b/scripts/danger/clean/cleaner.ts deleted file mode 100644 index 69e8a63a0..000000000 --- a/scripts/danger/clean/cleaner.ts +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | import { registerTSPaths } from '../../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import * as Promise from 'bluebird' | ||
5 | import * as rimraf from 'rimraf' | ||
6 | import { initDatabaseModels, sequelizeTypescript } from '../../../server/initializers/database' | ||
7 | import { CONFIG } from '../../../server/initializers/config' | ||
8 | |||
9 | initDatabaseModels(true) | ||
10 | .then(() => { | ||
11 | return sequelizeTypescript.drop() | ||
12 | }) | ||
13 | .then(() => { | ||
14 | console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME) | ||
15 | |||
16 | const STORAGE = CONFIG.STORAGE | ||
17 | return Promise.mapSeries(Object.keys(STORAGE), storage => { | ||
18 | const storageDir = STORAGE[storage] | ||
19 | |||
20 | return new Promise((res, rej) => { | ||
21 | rimraf(storageDir, err => { | ||
22 | if (err) return rej(err) | ||
23 | |||
24 | console.info('%s deleted.', storageDir) | ||
25 | return res() | ||
26 | }) | ||
27 | }) | ||
28 | }) | ||
29 | .then(() => process.exit(0)) | ||
30 | }) | ||
31 | .catch(err => { | ||
32 | console.error(err) | ||
33 | process.exit(-1) | ||
34 | }) | ||
diff --git a/scripts/danger/clean/dev.sh b/scripts/danger/clean/dev.sh deleted file mode 100755 index 14b45e13b..000000000 --- a/scripts/danger/clean/dev.sh +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all directories and SQL tables. Are you sure? (y/*) " -n 1 -r | ||
6 | echo | ||
7 | |||
8 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
9 | NODE_ENV=test npm run ts-node -- --type-check "scripts/danger/clean/cleaner" | ||
10 | fi | ||
diff --git a/scripts/danger/clean/modules.sh b/scripts/danger/clean/modules.sh deleted file mode 100755 index f59d6b675..000000000 --- a/scripts/danger/clean/modules.sh +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all node server and client modules. Are you sure? " -n 1 -r | ||
6 | |||
7 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
8 | rm -rf node_modules client/node_modules | ||
9 | fi | ||
diff --git a/scripts/danger/clean/prod.sh b/scripts/danger/clean/prod.sh deleted file mode 100755 index 0675600c4..000000000 --- a/scripts/danger/clean/prod.sh +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | read -p "This will remove all directories and SQL tables. Are you sure? (y/*) " -n 1 -r | ||
6 | echo | ||
7 | |||
8 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
9 | NODE_ENV=production npm run ts-node -- --type-check "./scripts/danger/clean/cleaner" | ||
10 | fi | ||