add piston nix pkg for coffeescript]
This commit is contained in:
parent
96ffdb63dd
commit
2490833ef1
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Download and install NodeJS
|
||||
curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz
|
||||
tar xf node.tar.xz --strip-components=1
|
||||
rm node.tar.xz
|
||||
export PATH=$PWD/bin:$PATH
|
||||
|
||||
# Install CoffeeScript via npm and done
|
||||
npm install --global coffeescript@2.5.1
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "coffeescript",
|
||||
"version": "2.5.1",
|
||||
"aliases": ["coffeescript", "coffee"]
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
coffee "$@"
|
|
@ -1 +0,0 @@
|
|||
console.log "OK"
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue