Commit 60633b9d authored by Alf Watt's avatar Alf Watt

lIVeBuNdLe

Report trash errors
parent 7c43e19f
......@@ -16,5 +16,5 @@ jobs:
command: xcodebuild -scheme "LiveBundle (iOS)"
- run:
name: Build LiveBUndle (macOS)
name: Build LiveBundle (macOS)
command: xcodebuild -scheme "LiveBundle (macOS)"
This diff is collapsed.
......@@ -34,11 +34,25 @@ NSString* const ILPlistType = @"plist";
return firstMatch;
}
+ (BOOL) trashLiveBundles
+ (BOOL) trashLiveBundles:(NSError**) error
{
NSArray* searchPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSURL* liveBundlesURL = [NSURL fileURLWithPath:[searchPaths.lastObject stringByAppendingPathComponent:ILLiveBundles]];
return [NSFileManager.defaultManager trashItemAtURL:liveBundlesURL resultingItemURL:nil error:nil];
#if TARGET_OS_MAC
return [NSFileManager.defaultManager trashItemAtURL:liveBundlesURL resultingItemURL:nil error:error];
#else
return [NSFileManager.defaultManager removeItemAtURL:liveBundlesURL error:error];
#endif
}
+ (BOOL) trashLiveBundles
{
NSError* trashError = nil;
BOOL wasTrashed = [self trashLiveBundles:&trashError];
if (!wasTrashed) {
NSLog(@"trashLiveBundles error: %@", trashError);
}
return wasTrashed;
}
#pragma mark -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment