Skip to content

Commit 62fcf3b

Browse files
committed
Add prefix to signing related env vars, too
1 parent 8be972d commit 62fcf3b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/main.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,20 @@ int main(const int argc, const char* const* const argv) {
150150
args.push_back(strdup("-g"));
151151
}
152152

153-
if (getenv("SIGN") != nullptr) {
153+
doSomethingWithEnvVar({"LDAI_SIGN", "SIGN"}, [&](const auto& value) {
154+
(void) value;
154155
args.push_back(strdup("-s"));
155156

156-
const char* signingKey;
157-
if ((signingKey = getenv("SIGN_KEY")) != nullptr) {
157+
doSomethingWithEnvVar({"LDAI_SIGN_KEY", "SIGN_KEY"}, [&](const auto& signKey) {
158158
args.push_back(strdup("--sign-key"));
159-
args.push_back(strdup(signingKey));
160-
}
159+
args.push_back(strdup(signKey.c_str()));
160+
});
161161

162-
const char* signingArgs = getenv("SIGN_ARGS");
163-
if (signingArgs != nullptr) {
162+
doSomethingWithEnvVar({"LDAI_SIGN_ARGS", "SIGN_ARGS"}, [&](const auto& signArgs) {
164163
args.push_back(strdup("--sign-args"));
165-
args.push_back(strdup(signingArgs));
166-
}
167-
}
164+
args.push_back(strdup(signArgs.c_str()));
165+
});
166+
});
168167

169168
constexpr auto appimagetool_verbose_arg = "-v";
170169

0 commit comments

Comments
 (0)