Added cancelling

This commit is contained in:
COW_ILLUMINATI 2024-06-05 20:37:09 -04:00
parent fdbb824ad3
commit f76c0c7c28

@ -72,9 +72,9 @@ int main(int argc, char* argv[]) {
if (!std::filesystem::exists("/etc/cowtool/disabled/install_"+name+".sh")) { if (!std::filesystem::exists("/etc/cowtool/disabled/install_"+name+".sh")) {
std::cout << "First time installation! Watching you! Type 'manure' to complete the script!" << std::endl; std::cout << "First time installation! Watching you! Type 'manure' to cancel, 'exit' to save!" << std::endl;
chdir("/sources/cowtool/buildspace/"); chdir("/sources/cowtool/buildspace/");
std::cout << "Entered buildspace - don't for get to clean up before exiting!" << std::endl; std::cout << "Entered buildspace - don't forget to clean up before exiting!" << std::endl;
std::ofstream out; std::ofstream out;
out.open("/etc/cowtool/disabled/install_"+name+".sh", std::ios::app); out.open("/etc/cowtool/disabled/install_"+name+".sh", std::ios::app);
@ -96,9 +96,14 @@ int main(int argc, char* argv[]) {
out.close(); out.close();
} }
if (input=="manure") {
system((editor+" /etc/cowtool/disabled/install_"+name+".sh").c_str()); // Cancel!
std::cout << "Remember to `milk` to update `"+ name << "`!" << std::endl; system(("rm /etc/cowtool/disabled/install_"+name+".sh").c_str());
std::cout << "Cancelled `"+ name << "`!" << std::endl;
} else {
system((editor+" /etc/cowtool/disabled/install_"+name+".sh").c_str());
std::cout << "Remember to `milk` to update `"+ name << "`!" << std::endl;
}
} else if (firstArg == "milk") { } else if (firstArg == "milk") {