Skip to content

Commit

Permalink
Support for Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerhot committed Jun 23, 2022
1 parent 8a17215 commit 9a37cc1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/test_run_funcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
rust_string
test_multi_code_folders
deno_string
)
status=0
Expand Down
3 changes: 3 additions & 0 deletions gitfx/parse_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'.exs': 'elixir',
'.php': 'php',
'.sh': 'bash',
'.ts': 'deno',
'.rs': 'rust'}

COMMENT_PREFIX = {'python': '#',
Expand All @@ -31,6 +32,7 @@
'elixir': '#',
'php': '//',
'bash': '#',
'deno': '//',
'rust': '//'}


Expand Down Expand Up @@ -68,6 +70,7 @@ def parse(path):
'*.exs', # Elixir
'*.php', # PHP
'*sh', # Bash
'*.ts', # Deno
'*.rs') # Rust

files = [f for fs in [glob(os.path.join(path, t)) for t in types] for f in fs]
Expand Down
4 changes: 3 additions & 1 deletion gitfx/run_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'haskell',
'php',
'bash',
'deno',
'rust']

RUN_CMDS = {'ruby': 'ruby',
Expand All @@ -34,6 +35,7 @@
'elixir': 'elixir',
'haskell': 'runhaskell',
'rust': 'perl -e \'($n = $ARGV[0]) =~ s/\.rs$//; system "rustc $ARGV[0] && ./$n && rm $n"\'', # noqa
'deno': 'deno run --quiet --allow-all',
'php': 'php'}

LANG_DEP_FILE = {'ruby': 'Gemfile',
Expand All @@ -50,7 +52,7 @@
php composer-setup.php --install-dir=/usr/local/bin --filename=composer >/dev/null 2>&1 && \
php composer.phar install >/dev/null 2>&1'}

DOCKER_IMAGES = {}
DOCKER_IMAGES = {'deno': 'denoland/deno'}


def docker_image(lang):
Expand Down
3 changes: 3 additions & 0 deletions test/func_examples/function.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// GET /test/result/deno_string

console.log("hello, deno");

0 comments on commit 9a37cc1

Please sign in to comment.