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

View file

@ -1,3 +1,3 @@
project('dotty', 'cpp')
executable('dotty', 'main.cpp', dependencies: [])
executable('dotty', 'src/main.cpp', dependencies: [])

View file

@ -2,6 +2,7 @@
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
using namespace std;
using namespace std::filesystem;
@ -14,6 +15,11 @@ const path PACMAN_HOOKS = "/etc/pacman.d/hooks";
//
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;