diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 12d3bc4..38e68f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -182,7 +182,7 @@ void usageInit() printf(" --dynamic\t\t\tProject compiles to a dynamic library\n"); printf(" --lang\t\t\tProject template language - Optional (default: c++)\n"); printf("Examples:\n"); - printf(" sibs init --exec\n"); + printf(" sibs init . --exec\n"); printf(" sibs init dirA/dirB --dynamic"); exit(1); } @@ -226,6 +226,14 @@ bool isPathSubPathOf(const FileString &path, const FileString &subPathOf) return _tinydir_strncmp(path.c_str(), subPathOf.c_str(), subPathOf.size()) == 0; } +static bool doesProgramExist(const _tinydir_char_t *programName) +{ + FileString cmd = FileString(programName) + TINYDIR_STRING(" --version"); + Result<sibs::ExecResult> result = exec(cmd.c_str()); + bool programNotFound = !result && result.getErrorCode() == 127; + return !programNotFound; +} + int buildProject(const FileString &projectPath, const FileString &projectConfFilePath, SibsConfig &sibsConfig) { FileString buildPath; |