Skip to content

Commit 91bf3c7

Browse files
committed
Fix macOS compile errors
1 parent 6fa9938 commit 91bf3c7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

source/create_dialog_derived.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void CreateProjectDialogD::OnCreate(wxCommandEvent& event){
8484

8585
//create the command string
8686
#if defined __APPLE__
87-
string command = "\"" + executablePath + "\" -createproject \"" + projPath + dirsep + projName + "\" -cloneFromTemplate \"" + executableTemplatesPath + templatePrefix + "." + templateName + "\"";
87+
string command = "\"" + executablePath.string() + "\" -createproject \"" + (filesystem::path(projPath) / projName).string() + "\" -cloneFromTemplate \"" + executableTemplatesPath.string() + templatePrefix + "." + templateName + "\"";
8888
#elif defined _WIN32
8989
auto fullProj = std::filesystem::path("\"") / projPath / projName / "\"";
9090
auto fullTemplate = std::filesystem::path("\"") / executableTemplatesPath / (templatePrefix + "." + templateName + "\"");

source/globals.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ struct editor{
2525
#if defined __APPLE__
2626
#include <pwd.h>
2727
//the location to store application data
28-
static const std::string datapath = getpwuid(getuid())->pw_dir + std::string("/Library/Application Support/UnityHubNative");
28+
static const std::filesystem::path datapath = std::filesystem::path(getpwuid(getuid())->pw_dir) / "Library/Application Support/UnityHubNative";
2929
static const char dirsep = '/';
3030

31-
static const std::string cachedir = getpwuid(getuid())->pw_dir + std::string("/Library/Caches/com.ravbug.UnityHubNative/");
31+
static const std::filesystem::path cachedir = std::filesystem::path(getpwuid(getuid())->pw_dir) / "/Library/Caches/com.ravbug.UnityHubNative/";
3232
static const std::string installerExt = "dmg";
3333

3434
//where to find various Unity things on macOS
35-
static const std::string executable = "Unity.app/Contents/MacOS/Unity";
36-
static const std::vector<std::string> defaultInstall = {"/Applications/Unity/Hub/Editor","/Applications/Unity/"};
35+
static const std::filesystem::path executable = "Unity.app/Contents/MacOS/Unity";
36+
static const std::vector<std::filesystem::path> defaultInstall = {"/Applications/Unity/Hub/Editor","/Applications/Unity/"};
3737
//TODO: make this a preference?
38-
static const std::string hubDefault = "/Applications/Unity Hub.app";
39-
static const std::string templatesDir = "Unity.app/Contents/Resources/PackageManager/ProjectTemplates/";
38+
static const std::filesystem::path hubDefault = "/Applications/Unity Hub.app";
39+
static const std::filesystem::path templatesDir = "Unity.app/Contents/Resources/PackageManager/ProjectTemplates/";
4040

4141
//for stream redirecting to dev/null
4242
static const std::string null_device = ">/dev/null 2>&1";

0 commit comments

Comments
 (0)