diff --git a/uppsrc/ide/Builders/Build.cpp b/uppsrc/ide/Builders/Build.cpp index 05c345a43..b8bb12c80 100644 --- a/uppsrc/ide/Builders/Build.cpp +++ b/uppsrc/ide/Builders/Build.cpp @@ -100,9 +100,7 @@ void MakeBuild::CreateHost(Host& host, const String& method, bool darkmode, bool VectorMap bm = GetMethodVars(method); { VectorMap env = clone(Environment()); - DDUMP(env); host.exedirs = SplitDirs(bm.Get("PATH", "") + ';' + env.Get("PATH", "")); - DDUMP(env.Get("PATH", "")); #ifdef PLATFORM_WIN32 host.AddExecutable(GetExeDirFile("bin/mingit/cmd"), "git.exe"); host.AddExecutable(GetExeDirFile("bin/llvm/bin"), "clang-format.exe"); @@ -649,7 +647,6 @@ int HostSys(const char *cmd, String& out) mb->CreateHost(host, false, false); LocalProcess p; host.canlog = false; - DDUMP(cmd); if(host.StartProcess(p, cmd)) return p.Finish(out); return Null; diff --git a/uppsrc/ide/Core/Host.cpp b/uppsrc/ide/Core/Host.cpp index a0d49a96e..b7f630b19 100644 --- a/uppsrc/ide/Core/Host.cpp +++ b/uppsrc/ide/Core/Host.cpp @@ -134,8 +134,6 @@ bool Host::StartProcess(LocalProcess& p, const char *cmdline) try { if(canlog) Log(cmdline); p.NoConvertCharset(); - DDUMP(exedirs); - DDUMP(FindCommand(exedirs, cmdline)); if(p.Start(FindCommand(exedirs, cmdline), environment)) return true; } diff --git a/uppsrc/ide/FormatCode.cpp b/uppsrc/ide/FormatCode.cpp index 32e104961..c921ee642 100644 --- a/uppsrc/ide/FormatCode.cpp +++ b/uppsrc/ide/FormatCode.cpp @@ -159,7 +159,6 @@ String ReformatCpp(CodeEditor& editor, bool setcursor, bool prefer_clang_format) String r; int code = HostSys(cmd + temp_path, r); - DDUMP(code); DeleteFile(temp_path); diff --git a/uppsrc/ide/Upgrade.cpp b/uppsrc/ide/Upgrade.cpp index 73ca624a7..c29088b27 100644 --- a/uppsrc/ide/Upgrade.cpp +++ b/uppsrc/ide/Upgrade.cpp @@ -2,11 +2,25 @@ void Ide::UpgradeTheIDE() { - String idepath = GetExeFilePath(); - String newpath = idepath + ".new"; - String bakpath(~idepath, GetFileExtPos(idepath)); - bakpath << ".bak" << GetExeExt(); + String idepath, newpath, bakpath; +#ifdef PLATFORM_COCOA + idepath = GetAppFolder(); + String name = GetFileTitle(idepath); + idepath = GetFileFolder(idepath); + String target_dir = idepath + "/" + name + ".new"; + DeleteFolderDeep(target_dir); + RealizeDirectory(target_dir); + newpath = target_dir + "/" + name + ".app"; + bakpath = idepath + "/" + name + ".bak.app"; + idepath << "/" << name << ".app"; +#else + idepath = GetExeFilePath() + newpath = idepath + ".new"; + bakpath = String(~idepath, GetFileExtPos(idepath)); + bakpath << ".bak" << GetExeExt(); +#endif + int tbak = targetmode; String tmbak = StoreAsString(release); @@ -26,7 +40,11 @@ void Ide::UpgradeTheIDE() targetmode = 1; if(Build()) { - FileDelete(bakpath); + #ifdef PLATFORM_COCOA + DeleteFolderDeep(bakpath); + #else + FileDelete(bakpath); + #endif if(FileExists(bakpath)) Exclamation("Unable to delete&" + bakpath); else { @@ -34,10 +52,14 @@ void Ide::UpgradeTheIDE() FileMove(idepath, bakpath); PutVerbose("Moving " + newpath + " to " + idepath); FileMove(newpath, idepath); + #ifdef PLATFORM_COCOA + DeleteFolderDeep(target_dir); + #endif PutConsole("Upgrade finished, please restart theide."); } } + LoadFromString(release, tmbak); targetmode = tbak; } diff --git a/uppsrc/ide/idebar.cpp b/uppsrc/ide/idebar.cpp index 309823153..557507e58 100644 --- a/uppsrc/ide/idebar.cpp +++ b/uppsrc/ide/idebar.cpp @@ -416,15 +416,15 @@ void Ide::Setup(Bar& menu) } }); -#ifndef PLATFORM_COCOA const Workspace& wspc = IdeWorkspace(); if(wspc[0] == "ide") for(int i = 0; i < wspc.GetCount(); i++) - if(wspc[i] == "ide/Core") + if(wspc[i] == "ide/Core") { menu.Add("Upgrade TheIDE..", [=] { UpgradeTheIDE(); }); -#ifdef PLATFORM_POSIX + break; + } +#ifndef PLATFORM_COCOA menu.Add("Install theide.desktop", [=] { InstallDesktop(); }); -#endif #endif if(menu.IsMenuBar())