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
|
||||
===============================================================================
|
||||
C++ 4 320 253 20 47
|
||||
C++ Header 4 67 54 5 8
|
||||
C++ 4 319 251 21 47
|
||||
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 <sstream>
|
||||
#include "regex"
|
||||
|
@ -41,9 +39,7 @@ void Regex(cmd *inputCmd) {
|
|||
// Step 6: Write "+quit" at the end of the output buffer
|
||||
inputCmd->ids += "+quit\n";
|
||||
}
|
||||
}
|
||||
|
||||
void slashing(cmd *inputCmd) {
|
||||
std::istringstream inputStream(inputCmd->ids);
|
||||
std::string line;
|
||||
|
||||
|
@ -51,5 +47,4 @@ void slashing(cmd *inputCmd) {
|
|||
while (std::getline(inputStream, line)) {
|
||||
inputCmd->slashtp++;
|
||||
}
|
||||
inputCmd->slash = (inputCmd->slashtp == 2) ? R"( )": R"( \ )";
|
||||
}
|
||||
|
|
|
@ -30,5 +30,4 @@ int totalmeow = 0;
|
|||
};
|
||||
|
||||
void Regex(cmd *inputCmd);
|
||||
void slashing(cmd *inputCmd);
|
||||
#endif
|
||||
|
|
|
@ -142,7 +142,6 @@ int main(int argc, char **argv, char **envp) {
|
|||
|
||||
// main functions
|
||||
Regex(&inputCmd);
|
||||
slashing(&inputCmd);
|
||||
maincommand(&inputCmd);
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <atomic>
|
||||
|
@ -30,6 +32,9 @@ void execAndDisplay(cmd *inputCmd, const std::string& cmd, std::atomic<bool>& ru
|
|||
// checks for errors.
|
||||
if (line.find("ERROR!") != std::string::npos) {
|
||||
inputCmd->errors++;
|
||||
// tmp fix for errors.
|
||||
std::ofstream meow{"/home/rander/.cache/errors.txt"};
|
||||
meow << "start:\n" + line;
|
||||
}
|
||||
|
||||
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 maincommand2 = std::string{"sh ~/Steam/steamcmd.sh +force_install_dir "
|
||||
+ inputCmd->dir
|
||||
+ " +login "
|
||||
+ inputCmd->user
|
||||
+ inputCmd->pass
|
||||
+ inputCmd->slash
|
||||
+ idsm
|
||||
+ inputCmd->ids}.c_str();
|
||||
+ inputCmd->dir
|
||||
+ " +login "
|
||||
+ inputCmd->user
|
||||
+ ((inputCmd->pass.empty()) ? "" : inputCmd->pass)
|
||||
+ " "
|
||||
+ ((inputCmd->ab == 1) ? idsm: inputCmd->ids)}.c_str();
|
||||
|
||||
try {
|
||||
std::atomic<bool> running(true);
|
||||
|
@ -78,10 +82,11 @@ void maincommand(cmd *inputCmd) {
|
|||
std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)";
|
||||
|
||||
// shows how much and what has downloaded
|
||||
std::string mods = total + "\n"
|
||||
+ "Finished: " + std::to_string(inputCmd->successes +1) + "\n"
|
||||
+ "Timed out: " + std::to_string(inputCmd->timedout) + "\n"
|
||||
+ "Errored: " + std::to_string(inputCmd->errors) + "\n" + "\n";
|
||||
std::string mods = total
|
||||
+ "\n"
|
||||
+ "Finished: " + std::to_string(inputCmd->successes) + "\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";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue