This commit is contained in:
Benjamin Palko 2026-10-12 10:03:26 -04:00
parent 82164a46ac
commit cd509a92f3
2 changed files with 7 additions and 1 deletions

31
src/main.cpp Normal file
View file

@ -0,0 +1,31 @@
#include <filesystem>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
using namespace std;
using namespace std::filesystem;
const path PACMAN_HOOKS = "/etc/pacman.d/hooks";
//
// main is where all program execution starts
//
//
int main(int argc, char **argv) {
if (geteuid() != 0) {
cout << "Sudo permissions are required to run this application";
return 0;
}
if (!exists(PACMAN_HOOKS)) {
create_directory(PACMAN_HOOKS);
cout << "Directory created: " << PACMAN_HOOKS << endl;
return 0;
}
printf("Hello there.\n");
return 0;
}