implement writeBash with makeScriptWriter
This commit is contained in:
@@ -164,14 +164,9 @@ pkgs: oldpkgs: {
|
|||||||
echo hello world
|
echo hello world
|
||||||
''
|
''
|
||||||
*/
|
*/
|
||||||
writeBash = name: text:
|
writeBash = pkgs.makeScriptWriter {
|
||||||
assert (with types; either absolute-pathname filename).check name;
|
interpreter = "${pkgs.bash}/bin/bash";
|
||||||
pkgs.write (baseNameOf name) {
|
};
|
||||||
${optionalString (types.absolute-pathname.check name) name} = {
|
|
||||||
executable = true;
|
|
||||||
text = "#! ${pkgs.bash}/bin/bash\n${text}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
writeBashBin = name:
|
writeBashBin = name:
|
||||||
assert types.filename.check name;
|
assert types.filename.check name;
|
||||||
|
|||||||
Reference in New Issue
Block a user