diff --git a/api/src/utils/getRunTimeAndFilePath.ts b/api/src/utils/getRunTimeAndFilePath.ts index e36c931..b83cdee 100644 --- a/api/src/utils/getRunTimeAndFilePath.ts +++ b/api/src/utils/getRunTimeAndFilePath.ts @@ -5,14 +5,10 @@ import { RunTimeType } from '.' export const getRunTimeAndFilePath = async (programPath: string) => { const ext = path.extname(programPath) - // if program path is provided with extension we should split that into code path and ext as run time - if (ext) { + // If programPath (_program) is provided with a ".sas" or ".js" extension + // we should use that extension to determine the appropriate runTime + if (ext && Object.values(RunTimeType).includes(ext.slice(1) as RunTimeType)) { const runTime = ext.slice(1) - const runTimeTypes = Object.values(RunTimeType) - - if (!runTimeTypes.includes(runTime as RunTimeType)) { - throw `The '${runTime}' runtime is not supported.` - } const codePath = path .join(getFilesFolder(), programPath)