diff options
author | Pavol Rusnak <pavol@rusnak.io> | 2020-11-24 23:33:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 23:33:55 +0100 |
commit | 2b884eb9f698e8ef0bd45fa682a030c8a0e0ad2f (patch) | |
tree | 7e2f8d38a05a1b90a4bcb8ef78314b735e46e205 /pkgs/games/factorio | |
parent | 0c6fc3c05e1dc3a27676a3c95432da0754a1e2bf (diff) | |
parent | 86aa2a57d3a60d68af8689c4a1eb4da306f90c98 (diff) |
Merge pull request #104732 from lukegb/factorio-fail-if-no-creds
factorio: fail fetch early if no credentials provided
Diffstat (limited to 'pkgs/games/factorio')
-rw-r--r-- | pkgs/games/factorio/default.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/games/factorio/default.nix b/pkgs/games/factorio/default.nix index 0e2592de919e..6feac05309ca 100644 --- a/pkgs/games/factorio/default.nix +++ b/pkgs/games/factorio/default.nix @@ -104,10 +104,15 @@ let ]; }) (_: { # This preHook hides the credentials from /proc - preHook = '' - echo -n "${username}" >username - echo -n "${token}" >token - ''; + preHook = + if username != "" && token != "" then '' + 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 = '' cat <<EOF ${helpMsg} |