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

Commit0a54521

Browse files
committed
log all commands and fs actions for debugging
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentfc9218c commit0a54521

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎src/services/node/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,40 @@ interface ExecParams {
1717

1818
// correct paths to be from workspace root rather than extension folder
1919
constgetWorkspacePath=(...paths:string[])=>{
20-
returnjoin(WORKSPACE_ROOT, ...paths)
20+
constworkspacePath=join(WORKSPACE_ROOT, ...paths)
21+
logger(`Workspace path:${workspacePath}`)
22+
returnworkspacePath
2123
}
2224

2325
exportconstexec=(params:ExecParams):Promise<{stdout:string;stderr:string}>|never=>{
2426
constcwd=join(WORKSPACE_ROOT,params.dir||'')
27+
logger(`Calling command:${params.command}`)
2528
returnasyncExec(params.command,{ cwd})
2629
}
2730

2831
exportconstexists=(...paths:string[]):boolean|never=>{
29-
returnfs.existsSync(getWorkspacePath(...paths))
32+
constfilePath=getWorkspacePath(...paths)
33+
logger(`Check file exists:${filePath}`)
34+
returnfs.existsSync(filePath)
3035
}
3136

3237
exportconstremoveFile=(...paths:string[])=>{
33-
returnasyncRemoveFile(getWorkspacePath(...paths))
38+
constfilePath=getWorkspacePath(...paths)
39+
logger(`Removing file:${filePath}`)
40+
returnasyncRemoveFile(filePath)
3441
}
3542

3643
exportconstreadFile=(...paths:string[]):Promise<string|void>=>{
3744
constfilePath=getWorkspacePath(...paths)
45+
logger(`Reading file:${filePath}`)
3846
returnasyncReadFile(getWorkspacePath(...paths),'utf8').catch((err)=>{
3947
logger(`Failed to read from${filePath}:${err.message}`)
4048
})
4149
}
4250

4351
exportconstwriteFile=(data:any, ...paths:string[]):Promise<void>=>{
4452
constfilePath=getWorkspacePath(...paths)
53+
logger(`Writing file:${filePath}`)
4554
returnasyncWriteFile(filePath,data).catch((err)=>{
4655
logger(`Failed to write to${filePath}:${err.message}`)
4756
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp