mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-25 08:00:59 +00:00
fix(cli): fix push flow support for windows
This commit is contained in:
+4
-4
@@ -32,13 +32,13 @@ export async function pushApp(
|
||||
return;
|
||||
}
|
||||
alreadySynced.push(localPath);
|
||||
|
||||
remotePath.replaceAll(SEP, "/");
|
||||
let app: any = undefined;
|
||||
// deleting old app if it exists in raw mode
|
||||
try {
|
||||
app = await AppService.getAppByPath({
|
||||
workspace,
|
||||
path: remotePath.replaceAll(SEP, "/"),
|
||||
path: remotePath,
|
||||
});
|
||||
} catch {
|
||||
//ignore
|
||||
@@ -84,7 +84,7 @@ export async function pushApp(
|
||||
log.info(colors.bold.yellow(`Updating app ${remotePath}...`));
|
||||
await AppService.updateApp({
|
||||
workspace,
|
||||
path: remotePath.replaceAll(SEP, "/"),
|
||||
path: remotePath,
|
||||
requestBody: {
|
||||
deployment_message: message,
|
||||
...localApp,
|
||||
@@ -96,7 +96,7 @@ export async function pushApp(
|
||||
await AppService.createApp({
|
||||
workspace,
|
||||
requestBody: {
|
||||
path: remotePath.replaceAll(SEP, "/"),
|
||||
path: remotePath,
|
||||
deployment_message: message,
|
||||
...localApp,
|
||||
},
|
||||
|
||||
@@ -79,6 +79,7 @@ export async function pushFlow(
|
||||
return;
|
||||
}
|
||||
alreadySynced.push(localPath);
|
||||
remotePath = remotePath.replaceAll(SEP, "/");
|
||||
let flow: Flow | undefined = undefined;
|
||||
try {
|
||||
flow = await FlowService.getFlowByPath({
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
// deno-lint-ignore-file no-explicit-any
|
||||
|
||||
import { colors, log, path, yamlParse, yamlStringify } from "./deps.ts";
|
||||
import { SEP, colors, log, path, yamlParse, yamlStringify } from "./deps.ts";
|
||||
import { pushApp } from "./apps.ts";
|
||||
import { pushFolder } from "./folder.ts";
|
||||
import { pushFlow } from "./flow.ts";
|
||||
@@ -111,14 +111,14 @@ export async function pushObj(
|
||||
const typeEnding = getTypeStrFromPath(p);
|
||||
|
||||
if (typeEnding === "app") {
|
||||
const appName = p.split(".app" + path.sep)[0];
|
||||
const appName = p.split(".app" + SEP)[0];
|
||||
await pushApp(workspace, appName, appName + ".app", message);
|
||||
} else if (typeEnding === "folder") {
|
||||
await pushFolder(workspace, p, befObj, newObj);
|
||||
} else if (typeEnding === "variable") {
|
||||
await pushVariable(workspace, p, befObj, newObj, plainSecrets);
|
||||
} else if (typeEnding === "flow") {
|
||||
const flowName = p.split(".flow" + path.sep)[0];
|
||||
const flowName = p.split(".flow" + SEP)[0];
|
||||
await pushFlow(workspace, flowName, flowName + ".flow", message);
|
||||
} else if (typeEnding === "resource") {
|
||||
await pushResource(workspace, p, befObj, newObj);
|
||||
@@ -169,10 +169,10 @@ export function getTypeStrFromPath(
|
||||
| "user"
|
||||
| "group"
|
||||
| "settings" {
|
||||
if (p.includes(".flow" + path.sep)) {
|
||||
if (p.includes(".flow" + SEP)) {
|
||||
return "flow";
|
||||
}
|
||||
if (p.includes(".app" + path.sep)) {
|
||||
if (p.includes(".app" + SEP)) {
|
||||
return "app";
|
||||
}
|
||||
const parsed = path.parse(p);
|
||||
|
||||
Reference in New Issue
Block a user