From 947f56fbb054d2d2d5b5c91aee4a156c42f5b961 Mon Sep 17 00:00:00 2001 From: YR Chen Date: Fri, 22 Apr 2022 14:21:27 +0800 Subject: [PATCH] Fix `Process.findExecutable` --- Sources/TSCBasic/Process.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/TSCBasic/Process.swift b/Sources/TSCBasic/Process.swift index a2beb19a..444eb4e5 100644 --- a/Sources/TSCBasic/Process.swift +++ b/Sources/TSCBasic/Process.swift @@ -463,6 +463,13 @@ public final class Process { if localFileSystem.isExecutableFile(abs) { return abs } +#if os(Windows) + if abs.extension != "exe" && abs.extension != "", + case let abs = abs.parentDirectory.appending(component: abs.basename + executableFileSuffix), + localFileSystem.isExecutableFile(abs) { + return abs + } +#endif } return nil }