diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2022-01-08 20:39:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-08 20:39:30 +0000 |
commit | 762a3f796f1ad10aa233fd7b4a71a93be0c43c88 (patch) | |
tree | 183ec7c948c2769c9d47999a0fccee4923bb274d /lib/tooling/strings-tool.js | |
parent | bf9d2334b9ad34434f2051b03b52b761781a134c (diff) | |
parent | 8109f52af343300b2659756066b22659d064fc02 (diff) | |
download | compiler-explorer-gh-1567.tar.gz compiler-explorer-gh-1567.zip |
Merge 8109f52af343300b2659756066b22659d064fc02 into bf9d2334b9ad34434f2051b03b52b761781a134cgh-1567
Diffstat (limited to 'lib/tooling/strings-tool.js')
-rw-r--r-- | lib/tooling/strings-tool.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/tooling/strings-tool.js b/lib/tooling/strings-tool.js index ce1feb662..7385b6319 100644 --- a/lib/tooling/strings-tool.js +++ b/lib/tooling/strings-tool.js @@ -22,16 +22,22 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +import { fileExists } from '../utils'; + import { BaseTool } from './base-tool'; export class StringsTool extends BaseTool { static get key() { return 'strings-tool'; } - runTool(compilationInfo, inputFilename, args) { + async runTool(compilationInfo, inputFilename, args) { if(!compilationInfo.filters.binary) { return this.createErrorResponse('Strings requires a binary output'); } - return super.runTool(compilationInfo, compilationInfo.executableFilename, args); + if (await fileExists(compilationInfo.executableFilename)) { + return super.runTool(compilationInfo, compilationInfo.executableFilename, args); + } else { + return super.runTool(compilationInfo, compilationInfo.outputFilename, args); + } } } |