Skip to content

Commit

Permalink
🚨 Kreedzt - remove eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreedzt committed May 15, 2020
1 parent 9dd8b1a commit ec35cda
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/utils/fixPath.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const path = require('path');
const fs = require('fs');
const log = require('electron-log');
const {
promisedReadDir,
promisedWriteFile,
promisedReadFile
} = require('./promisedFs');

const logger = log.scope('fixPath.js');

const REPLACE_SOURCE_STR = '../../../WebTools/GFTool/';
const PAGES_FOLDER_PATH = path.join(__dirname, '../../public/pages');

Expand All @@ -16,7 +19,7 @@ const PAGES_FOLDER_PATH = path.join(__dirname, '../../public/pages');
const replacePath = fileNames => {
const wrappedArr = fileNames.map(fileName => {
const wholeName = path.join(PAGES_FOLDER_PATH, fileName);
console.log('wholeName', wholeName);
logger.info('wholeName', wholeName);
return () =>
promisedReadFile(wholeName).then(content => {
// console.log('content', content);
Expand All @@ -31,18 +34,18 @@ const replacePath = fileNames => {
promisedReadDir(PAGES_FOLDER_PATH).then(fileNames => {
replacePath(fileNames)
.then(() => {
console.log('修改成功');
logger.info('修改成功');
})
.catch(err => {
console.log('修改失败');
logger.error('修改失败');
throw err;
});
});

fs.readdir(PAGES_FOLDER_PATH, (err, files) => {
if (err) {
console.error('未找到public目录, 程序可能运行异常');
logger.error('未找到public目录, 程序可能运行异常');
} else {
console.log('files', files);
logger.info('files', files);
}
});

0 comments on commit ec35cda

Please sign in to comment.