mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-16 02:05:36 +00:00
dev: allow specifying runtime version
Docker Image CI / build-and-push-image (push) Waiting to run
Maintain Release Merge PR / update-release-pr (push) Waiting to run
release-please / release-please (push) Waiting to run
test / test (18.x) (push) Waiting to run
test / test (20.x) (push) Waiting to run
test / test (22.x) (push) Waiting to run
Docker Image CI / build-and-push-image (push) Waiting to run
Maintain Release Merge PR / update-release-pr (push) Waiting to run
release-please / release-please (push) Waiting to run
test / test (18.x) (push) Waiting to run
test / test (20.x) (push) Waiting to run
test / test (22.x) (push) Waiting to run
This commit is contained in:
@@ -35,6 +35,17 @@ class Judge0Service extends BaseService {
|
||||
if ( runtime.startsWith('j0-') ) {
|
||||
return runtime.slice(3);
|
||||
}
|
||||
if ( runtime.includes('-') ) {
|
||||
const versionIndex = runtime.lastIndexOf('-');
|
||||
const langPart = runtime.slice(0, versionIndex);
|
||||
const versionPart = runtime.slice(versionIndex + 1);
|
||||
const lang = this.languages.find((lang) =>
|
||||
lang.language === langPart && lang.version === versionPart
|
||||
);
|
||||
if ( lang ) {
|
||||
return lang.judge0_id;
|
||||
}
|
||||
}
|
||||
let lang = this.languages.find((lang) => lang.language === runtime);
|
||||
if ( lang ) {
|
||||
return lang.judge0_id;
|
||||
|
||||
Reference in New Issue
Block a user