From f76c0c7c28727dab1b5ab0baca44521789508832 Mon Sep 17 00:00:00 2001 From: COW_ILLUMINATI Date: Wed, 5 Jun 2024 20:37:09 -0400 Subject: [PATCH] Added cancelling --- src/cowtool.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/cowtool.cpp b/src/cowtool.cpp index 366dff1..abb8c63 100644 --- a/src/cowtool.cpp +++ b/src/cowtool.cpp @@ -72,9 +72,9 @@ int main(int argc, char* argv[]) { 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/"); - 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; out.open("/etc/cowtool/disabled/install_"+name+".sh", std::ios::app); @@ -96,9 +96,14 @@ int main(int argc, char* argv[]) { out.close(); } - - system((editor+" /etc/cowtool/disabled/install_"+name+".sh").c_str()); - std::cout << "Remember to `milk` to update `"+ name << "`!" << std::endl; + if (input=="manure") { + // Cancel! + 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") {