File tree Expand file tree Collapse file tree
swift/Sources/Tools/image-segmenter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -382,7 +382,9 @@ struct ImageSegmenterCLI: AsyncParsableCommand {
382382 }
383383 try writeImage ( rendered, to: resolvedOutputPath)
384384 print ( " Output image written to \( resolvedOutputPath) " )
385+ #if os(macOS)
385386 openFile ( at: resolvedOutputPath)
387+ #endif
386388 }
387389
388390 // MARK: - Rendering
@@ -503,13 +505,15 @@ struct ImageSegmenterCLI: AsyncParsableCommand {
503505 }
504506 }
505507
508+ #if os(macOS)
506509 private func openFile( at path: String ) {
507510 let expanded = NSString ( string: path) . expandingTildeInPath
508511 let process = Process ( )
509512 process. executableURL = URL ( fileURLWithPath: " /usr/bin/open " )
510513 process. arguments = [ expanded]
511514 try ? process. run ( )
512515 }
516+ #endif
513517
514518 // MARK: - Parity helpers (.npy reader + CGImage builder + metrics)
515519
You can’t perform that action at this time.
0 commit comments