implement writeBash with makeScriptWriter

master
lassulus 7 years ago
parent 1cfb083a20
commit 40fde9eaad
  1. 11
      pkgs/default.nix

@ -164,14 +164,9 @@ pkgs: oldpkgs: {
echo hello world
''
*/
writeBash = name: text:
assert (with types; either absolute-pathname filename).check name;
pkgs.write (baseNameOf name) {
${optionalString (types.absolute-pathname.check name) name} = {
executable = true;
text = "#! ${pkgs.bash}/bin/bash\n${text}";
};
};
writeBash = pkgs.makeScriptWriter {
interpreter = "${pkgs.bash}/bin/bash";
};
writeBashBin = name:
assert types.filename.check name;

Loading…
Cancel
Save