diff --git a/uppsrc/ide/Core/Host.cpp b/uppsrc/ide/Core/Host.cpp index b98d08f82..c5c55ef47 100644 --- a/uppsrc/ide/Core/Host.cpp +++ b/uppsrc/ide/Core/Host.cpp @@ -177,6 +177,17 @@ String HostConsole = "powershell.exe"; String HostConsole = "/usr/bin/xterm -e"; #endif +#ifdef PLATFORM_POSIX +void RemoveConsoleScripts() +{ + FileTime tm = (GetSysTime() - 24*3600).AsFileTime(); + for(FindFile ff(ConfigFile("console-script-*")); ff; ff++) { + if(ff.GetLastWriteTime() < tm) + FileDelete(ff.GetPath()); + } +} +#endif + void Host::Launch(const char *_cmdline, bool console) { String cmdline = FindCommand(exedirs, _cmdline); diff --git a/uppsrc/ide/Core/Host.h b/uppsrc/ide/Core/Host.h index cb5b8bd82..a2afa0728 100644 --- a/uppsrc/ide/Core/Host.h +++ b/uppsrc/ide/Core/Host.h @@ -43,3 +43,7 @@ struct Host { private: bool HasPlatformFlag(const Index& cfg); }; + +#ifdef PLATFORM_POSIX +void RemoveConsoleScripts(); +#endif \ No newline at end of file diff --git a/uppsrc/ide/main.cpp b/uppsrc/ide/main.cpp index 2641f2269..499a3ea0d 100644 --- a/uppsrc/ide/main.cpp +++ b/uppsrc/ide/main.cpp @@ -153,6 +153,8 @@ void AppMain___() bool hasvars = FindFile(ConfigFile("*.var")); #ifdef PLATFORM_POSIX + RemoveConsoleScripts(); // remove old console-script files + String home = Environment().Get("UPP_HOME", Null); if(!IsNull(home)) SetHomeDirectory(home);