mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
make cli more reliable
This commit is contained in:
+18
-15
@@ -29,21 +29,23 @@ export function replaceInlineScripts(
|
||||
) {
|
||||
modules.forEach((m) => {
|
||||
if (m.value.type == "rawscript") {
|
||||
const path = m.value.content.split(" ")[1];
|
||||
m.value.content = Deno.readTextFileSync(localPath + path);
|
||||
const lock = m.value.lock;
|
||||
if (removeLocks && removeLocks.includes(path)) {
|
||||
m.value.lock = undefined;
|
||||
} else if (
|
||||
lock &&
|
||||
typeof lock == "string" &&
|
||||
lock.trimStart().startsWith("!inline ")
|
||||
) {
|
||||
const path = lock.split(" ")[1];
|
||||
try {
|
||||
m.value.lock = readInlinePathSync(localPath + path);
|
||||
} catch {
|
||||
log.error(`Lock file ${path} not found`);
|
||||
if (m.value.content.startsWith("!inline")) {
|
||||
const path = m.value.content.split(" ")[1];
|
||||
m.value.content = Deno.readTextFileSync(localPath + path);
|
||||
const lock = m.value.lock;
|
||||
if (removeLocks && removeLocks.includes(path)) {
|
||||
m.value.lock = undefined;
|
||||
} else if (
|
||||
lock &&
|
||||
typeof lock == "string" &&
|
||||
lock.trimStart().startsWith("!inline ")
|
||||
) {
|
||||
const path = lock.split(" ")[1];
|
||||
try {
|
||||
m.value.lock = readInlinePathSync(localPath + path);
|
||||
} catch {
|
||||
log.error(`Lock file ${path} not found`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (m.value.type == "forloopflow") {
|
||||
@@ -120,6 +122,7 @@ export async function pushFlow(
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
//@ts-ignore
|
||||
`Failed to create flow ${remotePath}: ${e.body ?? e.message}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ export async function pushFolder(
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
//@ts-ignore
|
||||
console.error(e.body);
|
||||
throw e;
|
||||
}
|
||||
@@ -87,6 +88,7 @@ export async function pushFolder(
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
//@ts-ignore
|
||||
throw Error(`Failed to create folder ${name}: ${e.body ?? e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -578,6 +578,7 @@ async function whoami(opts: {}) {
|
||||
log.info(JSON.stringify(whoamiInfo, null, 2));
|
||||
} catch (error) {
|
||||
log.error(
|
||||
//@ts-ignore
|
||||
colors.red(`Failed to retrieve whoami information: ${error.message}`)
|
||||
);
|
||||
}
|
||||
@@ -620,7 +621,7 @@ const command = new Command()
|
||||
.description("Remove an instance")
|
||||
.complete("instance", async () => (await allInstances()).map((x) => x.name))
|
||||
.arguments("<instance:string:instance>")
|
||||
.action(async (instance) => {
|
||||
.action(async (instance: any) => {
|
||||
const instances = await allInstances();
|
||||
|
||||
const choice = (await Select.prompt({
|
||||
|
||||
Reference in New Issue
Block a user