@@ -25,6 +25,7 @@ import { Version } from "../utilities/version";
2525import { BuildFlags } from "./BuildFlags" ;
2626import { Sanitizer } from "./Sanitizer" ;
2727import { SwiftlyConfig } from "./ToolchainVersion" ;
28+ import { lineBreakRegex } from "../utilities/tasks" ;
2829
2930/**
3031 * Contents of **Info.plist** on Windows.
@@ -235,7 +236,8 @@ export class SwiftToolchain {
235236 execFile ( "mdfind" , [ `kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'` ] ) ,
236237 this . getXcodeDeveloperDir ( ) ,
237238 ] ) ;
238- const spotlightXcodes = mdfindOutput . length > 0 ? mdfindOutput . trimEnd ( ) . split ( "\n" ) : [ ] ;
239+ const spotlightXcodes =
240+ mdfindOutput . length > 0 ? mdfindOutput . trimEnd ( ) . split ( lineBreakRegex ) : [ ] ;
239241 const selectedXcode = this . getXcodeDirectory ( xcodeDeveloperDir ) ;
240242
241243 // Combine the results from both commands
@@ -933,7 +935,7 @@ export class SwiftToolchain {
933935 }
934936 const { stdout } = await execSwift ( [ "--version" ] , { swiftExecutable } ) ;
935937 return {
936- compilerVersion : stdout . split ( "\n" , 1 ) [ 0 ] ,
938+ compilerVersion : stdout . split ( lineBreakRegex , 1 ) [ 0 ] ,
937939 paths : { runtimeLibraryPaths : [ "" ] } ,
938940 } ;
939941 } catch {
0 commit comments