Merge pull request #104732 from lukegb/factorio-fail-if-no-creds
factorio: fail fetch early if no credentials provided
This commit is contained in:
commit
2b884eb9f6
@ -104,10 +104,15 @@ let
|
|||||||
];
|
];
|
||||||
})
|
})
|
||||||
(_: { # This preHook hides the credentials from /proc
|
(_: { # This preHook hides the credentials from /proc
|
||||||
preHook = ''
|
preHook =
|
||||||
echo -n "${username}" >username
|
if username != "" && token != "" then ''
|
||||||
echo -n "${token}" >token
|
echo -n "${username}" >username
|
||||||
'';
|
echo -n "${token}" >token
|
||||||
|
'' else ''
|
||||||
|
# Deliberately failing since username/token was not provided, so we can't fetch.
|
||||||
|
# We can't use builtins.throw since we want the result to be used if the tar is in the store already.
|
||||||
|
exit 1
|
||||||
|
'';
|
||||||
failureHook = ''
|
failureHook = ''
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
${helpMsg}
|
${helpMsg}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user