mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-08 08:04:25 +00:00
feat(cli): make default typescript configurable
This commit is contained in:
@@ -1981,6 +1981,7 @@ struct ArchiveQueryParams {
|
||||
skip_variables: Option<bool>,
|
||||
skip_resources: Option<bool>,
|
||||
include_schedules: Option<bool>,
|
||||
default_ts: Option<String>,
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -2038,6 +2039,7 @@ async fn tarball_workspace(
|
||||
skip_secrets,
|
||||
skip_variables,
|
||||
include_schedules,
|
||||
default_ts,
|
||||
}): Query<ArchiveQueryParams>,
|
||||
) -> Result<([(headers::HeaderName, String); 2], impl IntoResponse)> {
|
||||
// require_admin(authed.is_admin, &authed.username)?;
|
||||
@@ -2087,7 +2089,13 @@ async fn tarball_workspace(
|
||||
for script in scripts {
|
||||
let ext = match script.language {
|
||||
ScriptLang::Python3 => "py",
|
||||
ScriptLang::Deno => "ts",
|
||||
ScriptLang::Deno => {
|
||||
if default_ts.as_ref().is_some_and(|x| x == "bun") {
|
||||
"deno.ts"
|
||||
} else {
|
||||
"ts"
|
||||
}
|
||||
}
|
||||
ScriptLang::Go => "go",
|
||||
ScriptLang::Bash => "sh",
|
||||
ScriptLang::Powershell => "ps1",
|
||||
@@ -2098,7 +2106,13 @@ async fn tarball_workspace(
|
||||
ScriptLang::Mssql => "ms.sql",
|
||||
ScriptLang::Graphql => "gql",
|
||||
ScriptLang::Nativets => "fetch.ts",
|
||||
ScriptLang::Bun => "bun.ts",
|
||||
ScriptLang::Bun => {
|
||||
if default_ts.as_ref().is_some_and(|x| x == "bun") {
|
||||
"ts"
|
||||
} else {
|
||||
"bun.ts"
|
||||
}
|
||||
}
|
||||
};
|
||||
archive
|
||||
.write_to_archive(&script.content, &format!("{}.{}", script.path, ext))
|
||||
|
||||
Reference in New Issue
Block a user