@@ -17,31 +17,40 @@ interface ExecParams {
1717
1818// correct paths to be from workspace root rather than extension folder
1919const getWorkspacePath = ( ...paths : string [ ] ) => {
20- return join ( WORKSPACE_ROOT , ...paths )
20+ const workspacePath = join ( WORKSPACE_ROOT , ...paths )
21+ logger ( `Workspace path: ${ workspacePath } ` )
22+ return workspacePath
2123}
2224
2325export const exec = ( params : ExecParams ) : Promise < { stdout : string ; stderr : string } > | never => {
2426 const cwd = join ( WORKSPACE_ROOT , params . dir || '' )
27+ logger ( `Calling command: ${ params . command } ` )
2528 return asyncExec ( params . command , { cwd } )
2629}
2730
2831export const exists = ( ...paths : string [ ] ) : boolean | never => {
29- return fs . existsSync ( getWorkspacePath ( ...paths ) )
32+ const filePath = getWorkspacePath ( ...paths )
33+ logger ( `Check file exists: ${ filePath } ` )
34+ return fs . existsSync ( filePath )
3035}
3136
3237export const removeFile = ( ...paths : string [ ] ) => {
33- return asyncRemoveFile ( getWorkspacePath ( ...paths ) )
38+ const filePath = getWorkspacePath ( ...paths )
39+ logger ( `Removing file: ${ filePath } ` )
40+ return asyncRemoveFile ( filePath )
3441}
3542
3643export const readFile = ( ...paths : string [ ] ) : Promise < string | void > => {
3744 const filePath = getWorkspacePath ( ...paths )
45+ logger ( `Reading file: ${ filePath } ` )
3846 return asyncReadFile ( getWorkspacePath ( ...paths ) , 'utf8' ) . catch ( ( err ) => {
3947 logger ( `Failed to read from ${ filePath } : ${ err . message } ` )
4048 } )
4149}
4250
4351export const writeFile = ( data : any , ...paths : string [ ] ) : Promise < void > => {
4452 const filePath = getWorkspacePath ( ...paths )
53+ logger ( `Writing file: ${ filePath } ` )
4554 return asyncWriteFile ( filePath , data ) . catch ( ( err ) => {
4655 logger ( `Failed to write to ${ filePath } : ${ err . message } ` )
4756 } )
0 commit comments