mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
46 lines
1,002 B
C++
46 lines
1,002 B
C++
#include "Core.h"
|
|
|
|
int GetRepo(String& path)
|
|
{
|
|
if(IsNull(path))
|
|
return NOT_REPO_DIR;
|
|
if(DirectoryExists(AppendFileName(path, ".svn")) || DirectoryExists(AppendFileName(path, "_svn")))
|
|
return SVN_DIR;
|
|
for(;;) {
|
|
String git = AppendFileName(path, ".git");
|
|
if(DirectoryExists(git) || FileExists(git))
|
|
return GIT_DIR;
|
|
if(DirectoryExists(AppendFileName(path, ".svn")))
|
|
return SVN_DIR;
|
|
String path0 = path;
|
|
path = GetFileFolder(path);
|
|
if(path == path0)
|
|
break;
|
|
}
|
|
return NOT_REPO_DIR;
|
|
}
|
|
|
|
int GetRepoKind(const String& p)
|
|
{
|
|
String pp = p;
|
|
return GetRepo(pp);
|
|
}
|
|
|
|
String GetGitPath()
|
|
{
|
|
#ifdef PLATFORM_WIN32
|
|
static String path;
|
|
ONCELOCK {
|
|
path = AppendFileName(GetExeFolder(), "\\bin\\mingit\\cmd\\git.exe");
|
|
path = FileExists(path) ? "\"" + path + "\"" : "git";
|
|
}
|
|
return path;
|
|
#else
|
|
return "git";
|
|
#endif
|
|
}
|
|
|
|
bool IsGLSLExt(const String& ext)
|
|
{
|
|
return findarg(ext, ".vert", ".tesc", ".tese", ".geom", ".frag", ".comp") >= 0;
|
|
}
|