@@ -18,7 +18,7 @@ class MutagenDaemon: FileSyncDaemon {
18
18
19
19
private var mutagenProcess : Process ?
20
20
private var mutagenPipe : Pipe ?
21
- private let mutagenPath : URL
21
+ private let mutagenPath : URL !
22
22
private let mutagenDataDirectory : URL
23
23
private let mutagenDaemonSocket : URL
24
24
@@ -28,10 +28,11 @@ class MutagenDaemon: FileSyncDaemon {
28
28
29
29
init ( ) {
30
30
#if arch(arm64)
31
- mutagenPath = Bundle . main. url ( forResource: " mutagen-darwin-arm64 " , withExtension: nil ) !
31
+ mutagenPath = Bundle . main. url ( forResource: " mutagen-darwin-arm64 " , withExtension: nil )
32
32
#elseif arch(x86_64)
33
- mutagenPath = Bundle . main. url ( forResource: " mutagen-darwin-amd64 " , withExtension: nil ) !
33
+ mutagenPath = Bundle . main. url ( forResource: " mutagen-darwin-amd64 " , withExtension: nil )
34
34
#else
35
+ mutagenPath = nil
35
36
fatalError ( " unknown architecture " )
36
37
#endif
37
38
mutagenDataDirectory = FileManager . default. urls (
@@ -41,7 +42,7 @@ class MutagenDaemon: FileSyncDaemon {
41
42
mutagenDaemonSocket = mutagenDataDirectory. appending ( path: " daemon " ) . appending ( path: " daemon.sock " )
42
43
// It shouldn't be fatal if the app was built without Mutagen embedded,
43
44
// but file sync will be unavailable.
44
- if !FileManager . default . fileExists ( atPath : mutagenPath. path ) {
45
+ if mutagenPath == nil {
45
46
logger. warning ( " Mutagen not embedded in app, file sync will be unavailable " )
46
47
state = . unavailable
47
48
}
0 commit comments