mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
add piston nix pkg for coffeescript]
This commit is contained in:
parent
96ffdb63dd
commit
2490833ef1
7 changed files with 58 additions and 20 deletions
|
@ -59,4 +59,5 @@ args: {
|
|||
"dotnet-sdk-visual-basic" = import ./dotnet-sdk-visual-basic.nix args;
|
||||
"fpc-pascal" = import ./fpc-pascal.nix args;
|
||||
"brainfuck" = import ./brainfuck.nix args;
|
||||
"node-coffeescript" = import ./node-coffeescript.nix args;
|
||||
}
|
||||
|
|
57
runtimes/node-coffeescript.nix
Normal file
57
runtimes/node-coffeescript.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.nodePackages.coffee-script;
|
||||
in piston.mkRuntime {
|
||||
language = "coffeescript";
|
||||
version = pkg.version;
|
||||
runtime = "node";
|
||||
|
||||
aliases = [
|
||||
"coffee"
|
||||
];
|
||||
|
||||
run = ''
|
||||
${pkg}/bin/coffee "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
# stdout test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.coffee" = ''
|
||||
console.log "OK"
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.coffee";
|
||||
})
|
||||
|
||||
# args test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.coffee" = ''
|
||||
console.log process.argv[2]
|
||||
'';
|
||||
};
|
||||
args = ["OK"];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.coffee";
|
||||
})
|
||||
|
||||
# stdin test
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.coffee" = ''
|
||||
process.stdin.on('data', (data) => console.log(data.toString()))
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "OK";
|
||||
packages = [];
|
||||
main = "test.coffee";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue