mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-18 05:22:11 +00:00
23 lines
503 B
Swift
23 lines
503 B
Swift
import Foundation
|
|
|
|
struct ApplicationDirectoryController {
|
|
}
|
|
|
|
extension ApplicationDirectoryController {
|
|
|
|
var isInApplicationsDirectory: Bool {
|
|
#if DEBUG
|
|
return true
|
|
#else
|
|
let bundlePath = Bundle.main.bundlePath
|
|
for directory in NSSearchPathForDirectoriesInDomains(.applicationDirectory, .allDomainsMask, true) {
|
|
if bundlePath.hasPrefix(directory) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
#endif
|
|
}
|
|
|
|
}
|