From 0bbb9be629ce35c11e4bf4a5180810ae2b16e5b4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 24 Sep 2018 15:57:53 +0200 Subject: Fix TODOs, mainly escaping strings for ninja --- src/PkgConfig.cpp | 2 +- src/main.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/PkgConfig.cpp b/src/PkgConfig.cpp index 42d0d13..3a36f39 100644 --- a/src/PkgConfig.cpp +++ b/src/PkgConfig.cpp @@ -6,7 +6,7 @@ using namespace std; // TODO: Do not use pkg-config program. The same functionality can easily be achieved -// by reading files in /usr/bin/pkgconfig +// by reading files in /usr/share/pkgconfig // Or is there no downside to calling pkg-config program? namespace sibs { 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 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; -- cgit v1.2.3