Skip to content

Commit

Permalink
tasks: fix the bash assertion for tasks that use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Feb 22, 2025
1 parent 689b960 commit 905482f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/tasks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let
};
binary = lib.mkOption {
type = types.nullOr types.str;
description = "Override the binary name if it differs from from the output of `lib.getExe`.";
description = "Override the binary name from the default `package.meta.mainProgram`.";
default = null;
};
package = lib.mkOption {
Expand Down Expand Up @@ -123,8 +123,8 @@ in

assertions = [
{
assertion = lib.all (task: lib.hasPrefix "bash" task.binary || task.exports == [ ]) (lib.attrValues config.tasks);
message = "The 'exports' option for a task can only be set when 'binary' is set to 'bash' or 'bash-interactive'.";
assertion = lib.all (task: task.package.meta.mainProgram == "bash" || task.binary == "bash" || task.exports == [ ]) (lib.attrValues config.tasks);
message = "The 'exports' option for a task can only be set when 'package' is a bash package.";
}
];

Expand Down

0 comments on commit 905482f

Please sign in to comment.