Skip to content

Commit cbfc4cd

Browse files
committed
Only guess update info if user requested it
1 parent 62fcf3b commit cbfc4cd

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/main.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,16 @@ int main(const int argc, const char* const* const argv) {
135135
args.push_back(strdup("appimagetool"));
136136
args.push_back(strdup(appdir.Get().c_str()));
137137

138-
auto updateInformation = getenv("UPDATE_INFORMATION");
139-
140-
// also provide shorter version of the environment variable
141-
if (updateInformation == nullptr) {
142-
updateInformation = getenv("UPD_INFO");
143-
}
144-
145-
if (updateInformation != nullptr) {
146-
std::cout << "Embedding update information: " << updateInformation << std::endl;
138+
doSomethingWithEnvVar({"LDAI_UPDATE_INFORMATION", "UPDATE_INFORMATION", "LDAI_UPD_INFO", "UPD_INFO"}, [&](const auto& value) {
139+
std::cout << "Embedding update information: " << value << std::endl;
147140
args.push_back(strdup("-u"));
148-
args.push_back(updateInformation);
149-
} else {
141+
args.push_back(strdup(value.c_str()));
142+
});
143+
144+
doSomethingWithEnvVar({"LDAI_GUESS_UPDATE_INFORMATION"}, [&](const auto& value) {
145+
(void) value;
150146
args.push_back(strdup("-g"));
151-
}
147+
});
152148

153149
doSomethingWithEnvVar({"LDAI_SIGN", "SIGN"}, [&](const auto& value) {
154150
(void) value;

0 commit comments

Comments
 (0)