Skip to content

Commit

Permalink
Fix templates not being found
Browse files Browse the repository at this point in the history
  • Loading branch information
rdvdev2 committed Jan 2, 2022
1 parent bb3b999 commit 6d7e944
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ninja_syntax import Writer

COMPILER = "g++"
APP_VERSION = "2.0"
APP_VERSION = "2.1"

INCLUDES_REGEX = re.compile('#include\s+"(.*)"')

Expand Down
13 changes: 10 additions & 3 deletions src/main.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include <iostream>
#include <filesystem>
#include <unistd.h>

#include "colors.h"
#include "problem.h"
Expand All @@ -15,13 +16,19 @@

using namespace std;

int main(int argc, char** argv) {
const int BUFFSIZE = 1024;

int main() {
cout << "Advocat v" << APP_VERSION << " by Roger Díaz Viñolas ([email protected])" << endl;

if (argc < 1) {
char buf[BUFFSIZE];
auto len = readlink("/proc/self/exe", buf, BUFFSIZE);
if (len != -1) buf[len] = '\0';
else {
show_error("Can't find the templates");
return 1;
}
filesystem::path binary_dir = filesystem::path(argv[0]).parent_path();
filesystem::path binary_dir = filesystem::path(buf).parent_path();

Problem p;
filesystem::path cwd = filesystem::current_path();
Expand Down

0 comments on commit 6d7e944

Please sign in to comment.