File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ void Boinc::run() {
128128 const auto progs_dir = Setup::getProgramsHome ();
129129 FolderLock lock (project_dir);
130130 if (Setup::existsProgramsHome () && // need to check again here
131- !Git::git (progs_dir, " pull origin main -q --ff-only " , false )) {
131+ !Setup::pullProgramsHome ( false )) {
132132 Log::get ().error (" Failed to update programs repository" , false );
133133 const auto age = getFileAgeInDays (progs_dir);
134134 Log::get ().info (" Programs directory age: " + std::to_string (age) +
Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ void OeisManager::update(bool force) {
392392 }
393393 Log::get ().info (msg);
394394 // update programs repository using git pull
395- Git::git (progs_dir, " pull origin main -q --ff-only " );
395+ Setup::pullProgramsHome ( );
396396 }
397397
398398 // touch marker file to track the age (even in server mode)
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ void Setup::cloneProgramsHome(const std::string& git_url) {
160160 Git::clone (git_url, getLodaHome () + " programs" );
161161}
162162
163+ bool Setup::pullProgramsHome (bool fail_on_error) {
164+ return Git::git (getProgramsHome (), " pull origin main -q --ff-only" ,
165+ fail_on_error);
166+ }
167+
163168void Setup::checkDir (const std::string& home) {
164169 if (!isDir (home)) {
165170 Log::get ().error (
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ class Setup {
4646 const std::string& git_url =
4747 " https://github.com/loda-lang/loda-programs.git" );
4848
49+ static bool pullProgramsHome (bool fail_on_error = true );
50+
4951 static std::string getSetupValue (const std::string& key);
5052
5153 static bool getSetupFlag (const std::string& key, bool default_value);
You can’t perform that action at this time.
0 commit comments