Introduce App Directory Path (#572)
* Introduce app directory path concept * macos: Remove hacky way of using applicaiton directory * Update the new SaveManager * Address stack user after return * Remove unecessary property * Use std::string for filepath * Improve clang specific detections * Use new path system for imgui files * Improve helper for getting relative paths
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>Ship of Harkinian</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>launcher.sh</string>
|
||||
<string>soh</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.0.0</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
int main(void) {
|
||||
NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
|
||||
//If there isn't an App Support Directory yet ...
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir isDirectory:NULL]) {
|
||||
NSError *error = nil;
|
||||
//Create one
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:&error]) {
|
||||
NSLog(@"%@", error.localizedDescription);
|
||||
}
|
||||
else {
|
||||
// *** OPTIONAL *** Mark the directory as excluded from iCloud backups
|
||||
NSURL *url = [NSURL fileURLWithPath:appSupportDir];
|
||||
if (![url setResourceValue:@YES
|
||||
forKey:NSURLIsExcludedFromBackupKey
|
||||
error:&error])
|
||||
{
|
||||
NSLog(@"Error excluding %@ from backup %@", url.lastPathComponent, error.localizedDescription);
|
||||
}
|
||||
else {
|
||||
NSLog(@"Yay");
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s\n", [appSupportDir UTF8String]);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
APPPATH="${0%/*}"
|
||||
cd "${APPPATH}"
|
||||
APPPATH=$(pwd)
|
||||
APPSUPPORT=$(./appsupport)
|
||||
mkdir -p "${APPSUPPORT}/com.shipofharkinian.soh"
|
||||
cd "${APPSUPPORT}/com.shipofharkinian.soh"
|
||||
cp "${APPPATH}/oot.otr" .
|
||||
${APPPATH}/soh
|
||||
Reference in New Issue
Block a user