@@ -45,7 +45,7 @@ export default class EgoRock extends Plugin {
45
45
this . addSettingTab ( new EgoRockSettingsTab ( this . app , this ) )
46
46
47
47
this . registerMarkdownCodeBlockProcessor ( 'task-table' , ( source , element , context ) => {
48
- this . doCommandReturnString ( parseYaml ( source ) . command , element , this . settings . taskBinaryPath )
48
+ this . doCommandReturnString ( parseYaml ( source ) . command , element )
49
49
} )
50
50
}
51
51
@@ -112,10 +112,11 @@ export default class EgoRock extends Plugin {
112
112
return [ indices , rows ]
113
113
}
114
114
115
- doCommandReturnString ( commandString : string , el : any , taskwarriorBin = 'wsl task' ) {
115
+ doCommandReturnString ( commandString : string , el : any ) {
116
116
commandString = commandString . replace ( / ^ t a s k / , '' )
117
117
const reports = this . getReportNames ( )
118
118
const report = commandString . split ( ' ' ) . slice ( - 1 ) [ 0 ]
119
+ const taskwarriorBin = this . settings . taskBinaryPath
119
120
if ( reports . includes ( report ) ) {
120
121
const newCommand = `${ taskwarriorBin . trim ( ) } rc.detection:off rc.defaultwidth:1000 ${ commandString } `
121
122
const asciiTable = execSync ( newCommand ) . toString ( ) . split ( '\n' )
@@ -131,9 +132,10 @@ export default class EgoRock extends Plugin {
131
132
}
132
133
}
133
134
134
- doCommand ( commandString : string , taskwarriorBin = 'wsl task' ) {
135
+ doCommand ( commandString : string ) {
135
136
const reports = this . getReportNames ( )
136
137
const report = commandString . split ( ' ' ) [ 0 ]
138
+ const taskwarriorBin = this . settings . taskBinaryPath
137
139
if ( reports . includes ( report ) ) {
138
140
const newCommand = `${ taskwarriorBin . trim ( ) } ${ this . buildCommandForReport ( report ) } `
139
141
return JSON . parse ( execSync ( newCommand ) . toString ( ) )
@@ -171,7 +173,8 @@ export default class EgoRock extends Plugin {
171
173
}
172
174
173
175
getReports ( ) {
174
- const lines = execSync ( 'wsl task show report' ) . toString ( ) . split ( '\n' ) . filter ( line => line . match ( / ^ r e p o r t \. .+ / ) )
176
+ const taskwarriorBin = this . settings . taskBinaryPath
177
+ const lines = execSync ( `${ taskwarriorBin } task show report` ) . toString ( ) . split ( '\n' ) . filter ( line => line . match ( / ^ r e p o r t \. .+ / ) )
175
178
return lines
176
179
}
177
180
0 commit comments