Skip to content

Commit

Permalink
调整数据库位置;git log开发更多日志信息
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Oct 31, 2021
1 parent 3a3612c commit 1643f2a
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 52 deletions.
12 changes: 11 additions & 1 deletion app/db/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
"use strict";
const path = require('path');
const fs = require('fs');
const sh = require('shelljs');
const low = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const adapter = new FileSync(path.join(__dirname, 'db.json'));
const home = require('../lib/home')();
const dbTmp = require('./db.json');
const dbPath = path.join(home, '.gitmarsdb');
if (!sh.test('-f', dbPath)) {
fs.writeFileSync(dbPath, JSON.stringify(dbTmp, null, 4), 'utf-8');
fs.chmodSync(dbPath, 0o0755);
}
// const adapter = new FileSync(path.join(__dirname, 'db.json'))
const adapter = new FileSync(dbPath);
const db = low(adapter);
module.exports = db;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Loading

1 comment on commit 1643f2a

@vercel
Copy link

@vercel vercel bot commented on 1643f2a Oct 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.