Auflistung von Files auf gemounteten Drives
This commit is contained in:
parent
6037240052
commit
bc3da08d0c
@ -328,6 +328,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MARKETING_VERSION = 0.1;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
|
PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@ -349,6 +350,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MARKETING_VERSION = 0.1;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
|
PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class FinderHelper {
|
|||||||
var fileList = [YapsFile]()
|
var fileList = [YapsFile]()
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let items = try fm.contentsOfDirectory(at: path, includingPropertiesForKeys: nil, options: .skipsHiddenFiles).filter{ $0.pathExtension == "jpg" || $0.pathExtension == "jpeg" }
|
let items = try fm.contentsOfDirectory(at: path, includingPropertiesForKeys: [.volumeNameKey, .volumeIsRemovableKey, .volumeIsEjectableKey], options: [.skipsHiddenFiles, .skipsPackageDescendants]).filter{ $0.pathExtension.lowercased() == "jpg" || $0.pathExtension.lowercased() == "jpeg" }
|
||||||
|
|
||||||
var index = 0
|
var index = 0
|
||||||
for item in items {
|
for item in items {
|
||||||
@ -149,4 +149,25 @@ class FinderHelper {
|
|||||||
|
|
||||||
return URL(fileURLWithPath: fullPathRAW)
|
return URL(fileURLWithPath: fullPathRAW)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func listMounts() -> [URL] {
|
||||||
|
var mounts: [URL] = [URL]()
|
||||||
|
|
||||||
|
let keys: [URLResourceKey] = [.volumeNameKey, .volumeIsRemovableKey, .volumeIsEjectableKey]
|
||||||
|
let paths = FileManager().mountedVolumeURLs(includingResourceValuesForKeys: keys, options: [])
|
||||||
|
if let urls = paths {
|
||||||
|
for url in urls {
|
||||||
|
let components = url.pathComponents
|
||||||
|
if components.count > 1
|
||||||
|
&& components[1] == "Volumes"
|
||||||
|
&& !(components[2].contains("ime") && components[2].contains("achine")) // skip TimeMachine ^^
|
||||||
|
{
|
||||||
|
print(url)
|
||||||
|
mounts.append(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mounts
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
|
|||||||
@ -8,5 +8,7 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.files.user-selected.read-write</key>
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.security.files.bookmarks.app-scope</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user