aboutsummaryrefslogtreecommitdiff
path: root/src/add_repo.cc
diff options
context:
space:
mode:
authordacctal <dacctalyt@gmail.com>2026-04-03 14:56:05 +0000
committerdacctal <dacctalyt@gmail.com>2026-04-03 14:56:05 +0000
commited78991edc4755c0276dcb4eb454b43fa38296fc (patch)
tree460da5399e34e1dce7a293cb22578da15977d895 /src/add_repo.cc
parent2a6b92ed130ade1ea7542ee210e6957427a0aa81 (diff)
countless changes
Diffstat (limited to 'src/add_repo.cc')
-rw-r--r--src/add_repo.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/add_repo.cc b/src/add_repo.cc
new file mode 100644
index 0000000..3de06dc
--- /dev/null
+++ b/src/add_repo.cc
@@ -0,0 +1,20 @@
+#include <fstream>
+#include <string>
+
+#include "add_repo.hh"
+#include "vars.hh"
+
+void add_repo(std::string repo, std::string repo_name) {
+ std::ifstream rfile(repo_file);
+ std::string rfile_line;
+ std::string rfile_contents;
+ while (getline(rfile, rfile_line)) {
+ rfile_contents += rfile_line + "\n";
+ }
+ rfile.close();
+
+ std::ofstream wfile;
+ wfile.open(repo_file);
+ wfile << rfile_contents << "repos[\"" << repo_name << "\"] = \"" << repo << "\"" << std::endl;
+ wfile.close();
+}