From ec35cdaa895a695107faaaaebc1359793f894528 Mon Sep 17 00:00:00 2001 From: Kreedzt Date: Fri, 15 May 2020 11:02:51 +0800 Subject: [PATCH] :rotating_light: Kreedzt - remove eslint warnings --- src/utils/fixPath.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/fixPath.js b/src/utils/fixPath.js index 682ed3d..7183f59 100644 --- a/src/utils/fixPath.js +++ b/src/utils/fixPath.js @@ -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'); @@ -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); @@ -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); } });