Skip to content

Commit

Permalink
string replace
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuyule committed Feb 2, 2018
1 parent f10c35b commit 153d5a3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/moe-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class MoeditorApplication {
this.windows = new Array();
this.hexoWindow = null;

global.storePath = path.join(require('os').homedir(),'Documents','HexoEditor');
global.appDataPath = path.join(require('os').homedir(),'Documents','HexoEditor');
log4js.configure({
appenders: {
out: {type: 'stdout', level: 'all'},//设置是否在控制台打印日志
debugs: {type: 'file', filename: path.join(storePath,'logs/debug.log'), level: 'debug',maxLogSize: 1024*1024*5},
infos: {type: 'file', filename: path.join(storePath,'logs/log.log'), level: 'debug',maxLogSize: 1024*1024*5},
errors: { type: 'file', filename: path.join(storePath,'logs/error.log') ,maxLogSize: 1024*1024*2},
debugs: {type: 'file', filename: path.join(appDataPath,'logs','debug.log'), level: 'debug',maxLogSize: 1024*1024*5},
infos: {type: 'file', filename: path.join(appDataPath,'logs','log.log'), level: 'debug',maxLogSize: 1024*1024*5},
errors: { type: 'file', filename: path.join(appDataPath,'logs','error.log') ,maxLogSize: 1024*1024*2},
debug: { type: 'logLevelFilter', appender: 'debugs', level: 'debug' },
info: { type: 'logLevelFilter', appender: 'infos', level: 'info' },
error: { type: 'logLevelFilter', appender: 'errors', level: 'error' }
Expand Down Expand Up @@ -94,7 +94,7 @@ class MoeditorApplication {
this.locale = new MoeditorLocale();
global.__ = str => this.locale.get(str);
this.flag = new Object();
moeApp.storePath = storePath;
moeApp.appDataPath = appDataPath;


const a = process.argv;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HexoEditor",
"version": "1.3.22",
"version": "1.3.24",
"description": "This is markdown editor for Hexo.",
"main": "app/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion views/main/hexo-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ImgManager {
fs.access(rootPaht, fs.constants.R_OK | fs.constants.W_OK, (err) => {
if(err){
log.warn(`setting [${rootPaht}] failed.` + err)
rootPaht = path.join(moeApp.storePath,'images');
rootPaht = path.join(moeApp.appDataPath,'images');
} else {
log.info(`setting [${rootPaht}] success.`)
}
Expand Down
2 changes: 1 addition & 1 deletion views/main/hexo/previewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Previewer.prototype.render = function (content, MoeMark, options, callback) {
srcLocal = path.join(hexoWindow.directory, src);
//最后查询文档所在目录
if (!srcLocal)
srcLocal = path.join(moeApp.storePath,'images');
srcLocal = path.join(moeApp.appDataPath,'images');

img.id = src;
img.setAttribute('localImg', true);
Expand Down

0 comments on commit 153d5a3

Please sign in to comment.