mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
tstest/tailmac: fix Host.app path generation (#13953)
updates tailscale/corp#24197 Generation of the Host.app path was erroneous and tailmac run would not work unless the pwd was tailmac/bin. Now you can be able to invoke tailmac from anywhere. Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
This commit is contained in:
parent
9545e36007
commit
0f9a054cba
@ -100,7 +100,10 @@ extension Tailmac {
|
||||
mutating func run() {
|
||||
let process = Process()
|
||||
let stdOutPipe = Pipe()
|
||||
let appPath = "./Host.app/Contents/MacOS/Host"
|
||||
|
||||
let executablePath = CommandLine.arguments[0]
|
||||
let executableDirectory = (executablePath as NSString).deletingLastPathComponent
|
||||
let appPath = executableDirectory + "/Host.app/Contents/MacOS/Host"
|
||||
|
||||
process.executableURL = URL(
|
||||
fileURLWithPath: appPath,
|
||||
@ -109,7 +112,7 @@ extension Tailmac {
|
||||
)
|
||||
|
||||
if !FileManager.default.fileExists(atPath: appPath) {
|
||||
fatalError("Could not find Host.app. This must be co-located with the tailmac utility")
|
||||
fatalError("Could not find Host.app at \(appPath). This must be co-located with the tailmac utility")
|
||||
}
|
||||
|
||||
process.arguments = ["run", "--id", id]
|
||||
|
Loading…
x
Reference in New Issue
Block a user