Move to data folder
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Discord utility bot",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "mkdir -p src/logs && while true; do node --no-warnings src/index.js; [ $? -ne 0 ] || break; done",
|
||||
"start": "mkdir -p src/data/logs && while true; do node --no-warnings src/index.js; [ $? -ne 0 ] || break; done",
|
||||
"dev": "DEVELOPMENT=true node --no-warnings src/index.js"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
0
src/data/.gitkeep
Normal file
0
src/data/.gitkeep
Normal file
0
src/data/logs/.gitkeep
Normal file
0
src/data/logs/.gitkeep
Normal file
@@ -1,6 +1,6 @@
|
||||
const sqlite3 = require('sqlite3').verbose();
|
||||
const path = require('path');
|
||||
const dbpath = path.join(__dirname, '..', 'data.db');
|
||||
const dbpath = path.join(__dirname, '..', 'data', 'data.db');
|
||||
function main(ctx) {
|
||||
const { bot, options } = ctx;
|
||||
bot.database = {
|
||||
|
||||
@@ -2,14 +2,15 @@ const chalk = require('chalk');
|
||||
const readline = require('readline');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const logDir = path.join(__dirname, '..', 'data', 'logs');
|
||||
|
||||
function main(ctx) {
|
||||
const { bot, options } = ctx;
|
||||
|
||||
bot.logger = {
|
||||
logDir: path.join(__dirname, '..', 'logs'),
|
||||
logDir,
|
||||
logPath: path.join(
|
||||
path.join(__dirname, '..', 'logs'),
|
||||
logDir,
|
||||
Math.floor(+new Date() / 1000).toString() + '.log'
|
||||
),
|
||||
log(...args) {
|
||||
|
||||
Reference in New Issue
Block a user