bugfix: it now downloads the entire collection
This commit is contained in:
parent
e569cbb436
commit
1b015de156
5 changed files with 19 additions and 21 deletions
|
@ -1,8 +1,8 @@
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Language Files Lines Code Comments Blanks
|
Language Files Lines Code Comments Blanks
|
||||||
===============================================================================
|
===============================================================================
|
||||||
C++ 4 320 253 20 47
|
C++ 4 319 251 21 47
|
||||||
C++ Header 4 67 54 5 8
|
C++ Header 4 66 53 5 8
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Total 8 387 307 25 55
|
Total 8 385 304 26 55
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "regex"
|
#include "regex"
|
||||||
|
@ -41,9 +39,7 @@ void Regex(cmd *inputCmd) {
|
||||||
// Step 6: Write "+quit" at the end of the output buffer
|
// Step 6: Write "+quit" at the end of the output buffer
|
||||||
inputCmd->ids += "+quit\n";
|
inputCmd->ids += "+quit\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void slashing(cmd *inputCmd) {
|
|
||||||
std::istringstream inputStream(inputCmd->ids);
|
std::istringstream inputStream(inputCmd->ids);
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
|
@ -51,5 +47,4 @@ void slashing(cmd *inputCmd) {
|
||||||
while (std::getline(inputStream, line)) {
|
while (std::getline(inputStream, line)) {
|
||||||
inputCmd->slashtp++;
|
inputCmd->slashtp++;
|
||||||
}
|
}
|
||||||
inputCmd->slash = (inputCmd->slashtp == 2) ? R"( )": R"( \ )";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,5 +30,4 @@ int totalmeow = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Regex(cmd *inputCmd);
|
void Regex(cmd *inputCmd);
|
||||||
void slashing(cmd *inputCmd);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -142,7 +142,6 @@ int main(int argc, char **argv, char **envp) {
|
||||||
|
|
||||||
// main functions
|
// main functions
|
||||||
Regex(&inputCmd);
|
Regex(&inputCmd);
|
||||||
slashing(&inputCmd);
|
|
||||||
maincommand(&inputCmd);
|
maincommand(&inputCmd);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
@ -30,6 +32,9 @@ void execAndDisplay(cmd *inputCmd, const std::string& cmd, std::atomic<bool>& ru
|
||||||
// checks for errors.
|
// checks for errors.
|
||||||
if (line.find("ERROR!") != std::string::npos) {
|
if (line.find("ERROR!") != std::string::npos) {
|
||||||
inputCmd->errors++;
|
inputCmd->errors++;
|
||||||
|
// tmp fix for errors.
|
||||||
|
std::ofstream meow{"/home/rander/.cache/errors.txt"};
|
||||||
|
meow << "start:\n" + line;
|
||||||
}
|
}
|
||||||
|
|
||||||
inputCmd->totalmeow++;
|
inputCmd->totalmeow++;
|
||||||
|
@ -54,13 +59,12 @@ void maincommand(cmd *inputCmd) {
|
||||||
std::string idsm = (inputCmd->ab == 1) ? R"( +workshop_download_item )" + inputCmd->gameid + " " + inputCmd->modid + " +quit": R"()";
|
std::string idsm = (inputCmd->ab == 1) ? R"( +workshop_download_item )" + inputCmd->gameid + " " + inputCmd->modid + " +quit": R"()";
|
||||||
|
|
||||||
std::string maincommand2 = std::string{"sh ~/Steam/steamcmd.sh +force_install_dir "
|
std::string maincommand2 = std::string{"sh ~/Steam/steamcmd.sh +force_install_dir "
|
||||||
+ inputCmd->dir
|
+ inputCmd->dir
|
||||||
+ " +login "
|
+ " +login "
|
||||||
+ inputCmd->user
|
+ inputCmd->user
|
||||||
+ inputCmd->pass
|
+ ((inputCmd->pass.empty()) ? "" : inputCmd->pass)
|
||||||
+ inputCmd->slash
|
+ " "
|
||||||
+ idsm
|
+ ((inputCmd->ab == 1) ? idsm: inputCmd->ids)}.c_str();
|
||||||
+ inputCmd->ids}.c_str();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
std::atomic<bool> running(true);
|
std::atomic<bool> running(true);
|
||||||
|
@ -78,10 +82,11 @@ void maincommand(cmd *inputCmd) {
|
||||||
std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)";
|
std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)";
|
||||||
|
|
||||||
// shows how much and what has downloaded
|
// shows how much and what has downloaded
|
||||||
std::string mods = total + "\n"
|
std::string mods = total
|
||||||
+ "Finished: " + std::to_string(inputCmd->successes +1) + "\n"
|
+ "\n"
|
||||||
+ "Timed out: " + std::to_string(inputCmd->timedout) + "\n"
|
+ "Finished: " + std::to_string(inputCmd->successes) + "\n"
|
||||||
+ "Errored: " + std::to_string(inputCmd->errors) + "\n" + "\n";
|
+ "Timed out: " + std::to_string(inputCmd->timedout) + "\n"
|
||||||
|
+ "Errored: " + std::to_string(inputCmd->errors) + "\n" + "\n";
|
||||||
|
|
||||||
std::cout << "\n\n" + mods + colm + " has been downloaded too: " + inputCmd->dir + "\n";
|
std::cout << "\n\n" + mods + colm + " has been downloaded too: " + inputCmd->dir + "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue