mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
writers: add writeFish and writeFishBin
This adds writers for Fish shell scripts, with syntax checking.
This commit is contained in:
parent
abf0c51335
commit
6e4a14b54f
@ -119,6 +119,21 @@ let
|
||||
writeDashBin = name:
|
||||
writeDash "/bin/${name}";
|
||||
|
||||
# Like writeScript but the first line is a shebang to fish
|
||||
#
|
||||
# Example:
|
||||
# writeFish "example" ''
|
||||
# echo hello world
|
||||
# ''
|
||||
writeFish = makeScriptWriter {
|
||||
interpreter = "${pkgs.fish}/bin/fish";
|
||||
check = "${pkgs.fish}/bin/fish --no-execute"; # syntax check only
|
||||
};
|
||||
|
||||
# Like writeScriptBin but the first line is a shebang to fish
|
||||
writeFishBin = name:
|
||||
writeFish "/bin/${name}";
|
||||
|
||||
# writeHaskell takes a name, an attrset with libraries and haskell version (both optional)
|
||||
# and some haskell source code and returns an executable.
|
||||
#
|
||||
|
@ -22,6 +22,12 @@ let
|
||||
test '~' = '~' && echo 'success'
|
||||
'';
|
||||
|
||||
fish = writeFishBin "test-writers-fish-bin" ''
|
||||
if test "test" = "test"
|
||||
echo "success"
|
||||
end
|
||||
'';
|
||||
|
||||
rust = writeRustBin "test-writers-rust-bin" {} ''
|
||||
fn main(){
|
||||
println!("success")
|
||||
@ -94,6 +100,12 @@ let
|
||||
test '~' = '~' && echo 'success'
|
||||
'';
|
||||
|
||||
fish = writeFish "test-writers-fish" ''
|
||||
if test "test" = "test"
|
||||
echo "success"
|
||||
end
|
||||
'';
|
||||
|
||||
haskell = writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } ''
|
||||
import Data.Default
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user