Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd856e95

Browse files
authored
Fix root path config resolve (#206)
fix:#196
1 parent1258d40 commitd856e95

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎packages/server/src/SettingStore.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import*asfsfrom'fs'
2+
import*aspathfrom'path'
23
importEventEmitterfrom'events'
34
importlog4jsfrom'log4js'
45

@@ -40,9 +41,9 @@ type PersonalConfig = {
4041
connections:Connection[]
4142
}
4243

43-
functionfileExists(path:string){
44+
functionfileExists(filePath:string){
4445
try{
45-
returnfs.statSync(path).isFile()
46+
returnfs.statSync(path.resolve(filePath)).isFile()
4647
}catch(e){
4748
consterr=easNodeJS.ErrnoException
4849
if(err&&err.code==='ENOENT'){
@@ -53,7 +54,7 @@ function fileExists(path: string) {
5354
}
5455

5556
functionreadFile(filePath:string){
56-
returnfs.readFileSync(filePath,'utf8').replace(/^\ufeff/u,'')
57+
returnfs.readFileSync(path.resolve(filePath),'utf8').replace(/^\ufeff/u,'')
5758
}
5859

5960
exportdefaultclassSettingStoreextendsEventEmitter.EventEmitter{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp