mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 13:53:49 -07:00
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:
parent
97ad234c8c
commit
7b04f67884
16 changed files with 186 additions and 70 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue