From 7b6d0dc93950e3f05d0012d596bb9dc0d87d537a Mon Sep 17 00:00:00 2001 From: radomir-sebek Date: Thu, 21 Jun 2018 15:32:37 +0200 Subject: [PATCH] MINOR: Add add_db_backup.js to be seen by eslint (#244) --- .gitignore | 3 ++- add_db_backup.js | 7 +++---- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e95a41e9fd..699ff15d49 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ Envoy.blade.php !/data/wallet.dat/.gitkeep /modules/Database/system.db @kadenceproject -test.* \ No newline at end of file +test.* +db_backup/* \ No newline at end of file diff --git a/add_db_backup.js b/add_db_backup.js index 220a899d39..9fe61e6539 100644 --- a/add_db_backup.js +++ b/add_db_backup.js @@ -1,12 +1,11 @@ const fs = require('fs'); const rimraf = require('rimraf'); -const exec = require('child_process').exec; +const { exec } = require('child_process'); const d = new Date(); const todaysDate = `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`; - if (fs.existsSync('./db_backup')) { console.log('Database backup directory already exists'); } else { @@ -82,7 +81,7 @@ if (fs.existsSync(`./db_backup/arango_db/arango-db-${todaysDate}`)) { setTimeout(() => { const files = fs.readdirSync('./db_backup/sqllite_db'); var i; - for (i = 0; i < files.length; i++) { + for (i = 0; i < files.length; i += 1) { const stats = fs.statSync(`./db_backup/sqllite_db/${files[i]}`); const ctime = new Date((stats.ctime)); @@ -107,7 +106,7 @@ setTimeout(() => { setTimeout(() => { const files = fs.readdirSync('./db_backup/arango_db'); var i; - for (i = 0; i < files.length; i++) { + for (i = 0; i < files.length; i += 1) { const stats = fs.statSync(`./db_backup/arango_db/${files[i]}`); const ctime = new Date((stats.ctime)); diff --git a/package.json b/package.json index 9dd37db715..9aa7f19c83 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test:api": "nyc mocha --recursive test/api/*.test.js", "start": "node node_version_check.js && node ot-node.js", "config": "rm modules/Database/system.db &> /dev/null || true && touch modules/Database/system.db; ./node_modules/.bin/sequelize db:migrate; ./node_modules/.bin/sequelize db:seed:all", - "lint": "./node_modules/.bin/eslint --quiet migrations/ models/ modules/ seeders/ test/ ot-node.js .eslintrc.js isStartHealthy.js node_version_check.js switchDatabase.js", + "lint": "./node_modules/.bin/eslint --quiet migrations/ models/ modules/ seeders/ test/ ot-node.js .eslintrc.js isStartHealthy.js node_version_check.js switchDatabase.js add_db_backup.js", "arango": "/usr/local/opt/arangodb/sbin/arangod &", "db_backup": " node add_db_backup.js" },