2020-09-22 06:12:50 +00:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct ApplicationDirectoryController {
|
|
|
|
}
|
|
|
|
|
|
|
|
extension ApplicationDirectoryController {
|
|
|
|
|
|
|
|
var isInApplicationsDirectory: Bool {
|
|
|
|
let bundlePath = Bundle.main.bundlePath
|
2020-11-26 02:13:46 +00:00
|
|
|
for directory in NSSearchPathForDirectoriesInDomains(.allApplicationsDirectory, .allDomainsMask, true) {
|
2020-09-22 06:12:50 +00:00
|
|
|
if bundlePath.hasPrefix(directory) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if bundlePath.contains("/Library/Developer/Xcode") {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|