Skip to content

Commit 1d97cd8

Browse files
committed
Allow GitLab snippets
Let's be more inclusive!
1 parent 7fbc72c commit 1d97cd8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/EvalbotExecuter.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ sub run {
108108
my $raw_link = (values %{$json->{files}})[0]{links}->{self}->{href};
109109
$program = `curl -s \Q$raw_link\E`;
110110
}
111+
} elsif ($program =~ /^https:\/\/gitlab\.com\/snippets\/(\d+)$/) {
112+
$program = decode_utf8 `curl --fail -s https://gitlab.com/snippets/\Q$1\E/raw`;
113+
return 'snippet not found' if $program eq '';
111114
}
112115
return _fork_and_eval($program, $executer, $ename);
113116
}

0 commit comments

Comments
 (0)