Skip to content

Commit 62911b1

Browse files
authored
fix empty programs dir error (#363)
1 parent ca3200f commit 62911b1

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
### Bugfixes
6+
7+
* Fix empty programs directory error in BOINC
8+
59
## v24.12.27
610

711
### Enhancements

src/sys/setup.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ void Setup::setProgramsHome(const std::string& home) {
150150
checkDir(PROGRAMS_HOME);
151151
}
152152

153+
bool Setup::existsProgramsHome() {
154+
// We cannot use getProgramsHome() here because it checks for existence
155+
return isDir(getLodaHome() + "programs");
156+
}
157+
158+
void Setup::cloneProgramsHome(const std::string& git_url) {
159+
// We cannot use getProgramsHome() here because it checks for existence
160+
Git::clone(git_url, getLodaHome() + "programs");
161+
}
162+
153163
void Setup::checkDir(const std::string& home) {
154164
if (!isDir(home)) {
155165
Log::get().error(
@@ -424,14 +434,6 @@ bool Setup::checkEnvVars() {
424434
return true;
425435
}
426436

427-
bool Setup::existsProgramsHome() {
428-
return isDir(LODA_HOME + "programs" + FILE_SEP + ".git");
429-
}
430-
431-
void Setup::cloneProgramsHome(std::string git_url) {
432-
Git::clone(git_url, getLodaHome() + "programs");
433-
}
434-
435437
bool Setup::checkProgramsHome() {
436438
std::string line;
437439
if (!existsProgramsHome()) {

src/sys/setup.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ class Setup {
3636

3737
static const std::string& getOeisHome();
3838

39-
static bool existsProgramsHome();
40-
41-
static void cloneProgramsHome(
42-
std::string git_url = "https://github.com/loda-lang/loda-programs.git");
43-
4439
static const std::string& getProgramsHome();
4540

4641
static void setProgramsHome(const std::string& home);
4742

43+
static bool existsProgramsHome();
44+
45+
static void cloneProgramsHome(
46+
const std::string& git_url =
47+
"https://github.com/loda-lang/loda-programs.git");
48+
4849
static std::string getSetupValue(const std::string& key);
4950

5051
static bool getSetupFlag(const std::string& key, bool default_value);

0 commit comments

Comments
 (0)