mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
b0cb1e0b27
* Ansible execution and parsing * Working collections and pip dependencies * Remove unused vars * File resources logic for ansible * Make frontend for ansible and resource file * Format file * Change naming of file resource and inventory fields * Add autocomplete for file extension resource creation * Add endpoint to list file formats for resource types * Add CLI functionality to pull/push file resources * Add beta tag to ansible * Add Full image dockerfiles containing ansible * Prepare sqlx * Update cargo.lock * Update ansible path * Remove unused imports * Add back import removed by rust-analyzer * Improve ansible init code * Prepare sqlx * Change dockerfile to make the full windmill image * Remove old dockerfile * Improve autocomplete file resource extension select * Remove comment * Validate file extension * Add icons to text file resources * Remove editability of file resource types * Remove unused import * Missing space * Add yaml parser
63 lines
1.6 KiB
TypeScript
63 lines
1.6 KiB
TypeScript
export type ScriptLanguage =
|
|
| "python3"
|
|
| "deno"
|
|
| "bun"
|
|
| "nativets"
|
|
| "go"
|
|
| "bash"
|
|
| "powershell"
|
|
| "postgresql"
|
|
| "mysql"
|
|
| "bigquery"
|
|
| "snowflake"
|
|
| "mssql"
|
|
| "graphql"
|
|
| "php"
|
|
| "rust"
|
|
| "ansible";
|
|
|
|
export function inferContentTypeFromFilePath(
|
|
contentPath: string,
|
|
defaultTs: "bun" | "deno" | undefined
|
|
): ScriptLanguage {
|
|
if (contentPath.endsWith(".py")) {
|
|
return "python3";
|
|
} else if (contentPath.endsWith("fetch.ts")) {
|
|
return "nativets";
|
|
} else if (contentPath.endsWith("bun.ts")) {
|
|
return "bun";
|
|
} else if (contentPath.endsWith("deno.ts")) {
|
|
return "deno";
|
|
} else if (contentPath.endsWith(".ts")) {
|
|
return defaultTs ?? "bun";
|
|
} else if (contentPath.endsWith(".go")) {
|
|
return "go";
|
|
} else if (contentPath.endsWith(".my.sql")) {
|
|
return "mysql";
|
|
} else if (contentPath.endsWith(".bq.sql")) {
|
|
return "bigquery";
|
|
} else if (contentPath.endsWith(".sf.sql")) {
|
|
return "snowflake";
|
|
} else if (contentPath.endsWith(".ms.sql")) {
|
|
return "mssql";
|
|
} else if (contentPath.endsWith(".pg.sql")) {
|
|
return "postgresql";
|
|
} else if (contentPath.endsWith(".gql")) {
|
|
return "graphql";
|
|
} else if (contentPath.endsWith(".sh")) {
|
|
return "bash";
|
|
} else if (contentPath.endsWith(".ps1")) {
|
|
return "powershell";
|
|
} else if (contentPath.endsWith("php")) {
|
|
return "php";
|
|
} else if (contentPath.endsWith("rs")) {
|
|
return "rust";
|
|
} else if (contentPath.endsWith(".playbook.yml")) {
|
|
return "ansible";
|
|
} else {
|
|
throw new Error(
|
|
"Invalid language: " + contentPath.substring(contentPath.lastIndexOf("."))
|
|
);
|
|
}
|
|
}
|