Skip to content

Commit

Permalink
check if platform exists. add zed and vscode as platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitre committed Jan 6, 2025
1 parent 7ae3e5f commit 913d541
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion commandLine/src/defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
#define OFPROJECTGENERATOR_MINOR_VERSION "88"
#define OFPROJECTGENERATOR_MINOR_VERSION "88b"
#define OFPROJECTGENERATOR_PATCH_VERSION "0"

#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)
Expand Down
7 changes: 7 additions & 0 deletions commandLine/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,13 @@ int main(int argc, char ** argv) {


for (auto & t : targets) {
if(std::find(platformsOptions.begin(), platformsOptions.end(), t) != platformsOptions.end()) {
// alert ("target platform found " + t, 33);
} else {
alert ("target platform not found " + t, 35);
continue;
}

consoleSpace();
ofLogNotice() << "-----------------------------------------------";
ofLogNotice() << "target platform is: [" << t << "]";
Expand Down
6 changes: 4 additions & 2 deletions commandLine/src/projects/baseProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ vector<baseProject::Template> baseProject::listAvailableTemplates(string target)
}

bool baseProject::create(const fs::path & _path, string templateName){
// alert("baseProject::create " + path.string() + " : " + templateName, 35);
// alert("baseProject::create " + _path.string() + " : " + templateName, 35);
auto path = _path; // just because it is const
fs::current_path(path);

Expand All @@ -142,14 +142,15 @@ bool baseProject::create(const fs::path & _path, string templateName){

// templatePath = normalizePath(getPlatformTemplateDir());
templatePath = getPlatformTemplateDir();

ofLogNotice() << "templatePath: " << templatePath;
auto projectPath = fs::canonical(fs::current_path() / path);

// projectDir = path;
projectDir = "";
projectPath = normalizePath(projectPath);
ofLogNotice() << "projectPath: " << projectPath;

projectName = projectPath.filename().string();

// we had this in some projects. if we decide to keep this is the place
Expand All @@ -161,6 +162,7 @@ bool baseProject::create(const fs::path & _path, string templateName){
// it can be only "src"
fs::path projectSrc { projectDir / "src" };


if (fs::exists(projectSrc) && fs::is_directory(projectSrc)) {
bDoesSrcDirExist = true;
} else {
Expand Down
3 changes: 3 additions & 0 deletions commandLine/src/utils/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ static std::vector < std::string > platformsOptions {
"msys2",
"osx",
"vs",

"vscode",
"zed",
};

string generateUUID(const string & input);
Expand Down

0 comments on commit 913d541

Please sign in to comment.