mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-12 20:47:22 +01:00
22
Secretive/Controllers/ApplicationDirectoryController.swift
Normal file
22
Secretive/Controllers/ApplicationDirectoryController.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user