File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11import * as fs from 'fs'
2+ import * as path from 'path'
23import EventEmitter from 'events'
34import log4js from 'log4js'
45
@@ -40,9 +41,9 @@ type PersonalConfig = {
4041 connections : Connection [ ]
4142}
4243
43- function fileExists ( path : string ) {
44+ function fileExists ( filePath : string ) {
4445 try {
45- return fs . statSync ( path ) . isFile ( )
46+ return fs . statSync ( path . resolve ( filePath ) ) . isFile ( )
4647 } catch ( e ) {
4748 const err = e as NodeJS . ErrnoException
4849 if ( err && err . code === 'ENOENT' ) {
@@ -53,7 +54,7 @@ function fileExists(path: string) {
5354}
5455
5556function readFile ( filePath : string ) {
56- return fs . readFileSync ( filePath , 'utf8' ) . replace ( / ^ \ufeff / u, '' )
57+ return fs . readFileSync ( path . resolve ( filePath ) , 'utf8' ) . replace ( / ^ \ufeff / u, '' )
5758}
5859
5960export default class SettingStore extends EventEmitter . EventEmitter {
You can’t perform that action at this time.
0 commit comments