File tree 4 files changed +9
-2
lines changed
4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ void Boinc::run() {
128
128
const auto progs_dir = Setup::getProgramsHome ();
129
129
FolderLock lock (project_dir);
130
130
if (Setup::existsProgramsHome () && // need to check again here
131
- !Git::git (progs_dir, " pull origin main -q --ff-only " , false )) {
131
+ !Setup::pullProgramsHome ( false )) {
132
132
Log::get ().error (" Failed to update programs repository" , false );
133
133
const auto age = getFileAgeInDays (progs_dir);
134
134
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) {
392
392
}
393
393
Log::get ().info (msg);
394
394
// update programs repository using git pull
395
- Git::git (progs_dir, " pull origin main -q --ff-only " );
395
+ Setup::pullProgramsHome ( );
396
396
}
397
397
398
398
// 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) {
160
160
Git::clone (git_url, getLodaHome () + " programs" );
161
161
}
162
162
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
+
163
168
void Setup::checkDir (const std::string& home) {
164
169
if (!isDir (home)) {
165
170
Log::get ().error (
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ class Setup {
46
46
const std::string& git_url =
47
47
" https://github.com/loda-lang/loda-programs.git" );
48
48
49
+ static bool pullProgramsHome (bool fail_on_error = true );
50
+
49
51
static std::string getSetupValue (const std::string& key);
50
52
51
53
static bool getSetupFlag (const std::string& key, bool default_value);
You can’t perform that action at this time.
0 commit comments