aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c1ce277..3d970f4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -93,9 +93,9 @@ bool isSourceFile(tinydir_file *file)
return false;
}
-bool isPathSubPathOf(const char *path, const string &subPathOf)
+bool isPathSubPathOf(const string &path, const string &subPathOf)
{
- return _tinydir_strncmp(path, subPathOf.c_str(), subPathOf.size()) == 0;
+ return _tinydir_strncmp(path.c_str(), subPathOf.c_str(), subPathOf.size()) == 0;
}
int buildProject(int argc, const char **argv)
@@ -116,6 +116,14 @@ int buildProject(int argc, const char **argv)
if(projectPath.back() != '/')
projectPath += "/";
+ Result<string> projectRealPathResult = getRealPath(projectPath.c_str());
+ if(!projectRealPathResult)
+ {
+ cerr << "Failed to get real path for: '" << projectPath << "': " << projectRealPathResult.getErrMsg() << endl;
+ exit(40);
+ }
+ projectPath = projectRealPathResult.unwrap();
+
string projectConfFilePath = projectPath;
projectConfFilePath += "/project.conf";
validateFilePath(projectConfFilePath.c_str());
@@ -189,6 +197,7 @@ int buildProject(int argc, const char **argv)
Result<bool> buildResult = ninja.build(debugBuildPath.c_str());
if(buildResult.isErr())
{
+ cerr << "Failed to build ninja file: " << buildResult.getErrMsg() << endl;
exit(8);
}