feat: make CLI node compatible (#4347)

This commit is contained in:
Ruben Fiszel
2024-09-07 02:31:26 +02:00
committed by GitHub
parent d11284feb2
commit fd18f42e0f
19 changed files with 1466 additions and 247 deletions
+16 -3
View File
@@ -158,7 +158,7 @@ export async function FSFSElement(
);
}
} catch (e) {
log.warning(`Error reading dir: ${localP}, ${e}`);
log.warn(`Error reading dir: ${localP}, ${e}`);
}
},
// async getContentBytes(): Promise<Uint8Array> {
@@ -621,7 +621,7 @@ export async function elementsToMap(
continue;
}
} catch (e) {
log.warning(`Error reading variable ${path} to check for secrets`);
log.warn(`Error reading variable ${path} to check for secrets`);
}
}
map[entry.path] = content;
@@ -920,6 +920,7 @@ export async function pull(opts: GlobalOptions & SyncOptions) {
const conflicts = [];
const changedScripts: string[] = [];
const changedFlows: string[] = [];
const changedApps: string[] = [];
// deno-lint-ignore no-inner-declarations
async function addToChangedIfNotExists(p: string) {
@@ -931,6 +932,11 @@ export async function pull(opts: GlobalOptions & SyncOptions) {
if (!changedFlows.includes(folder)) {
changedFlows.push(folder);
}
} else if (p.includes(".app" + SEP)) {
const folder = p.substring(0, p.indexOf(".app" + SEP)) + ".app" + SEP;
if (!changedApps.includes(folder)) {
changedApps.push(folder);
}
} else {
if (!changedScripts.includes(p)) {
changedScripts.push(p);
@@ -1072,6 +1078,13 @@ export async function pull(opts: GlobalOptions & SyncOptions) {
log.info(`Updating lock for flow ${change}`);
await generateFlowLockInternal(change, false, workspace, true);
}
if (changedApps.length > 0) {
log.info(
`Apps ${changedApps.join(
", "
)} scripts were changed but ignoring for now`
);
}
log.info(
colors.bold.green.underline(
`\nDone! All ${changes.length} changes applied locally and wmill-lock.yaml updated.`
@@ -1327,7 +1340,7 @@ export async function push(opts: GlobalOptions & SyncOptions) {
case "folder":
await FolderService.deleteFolder({
workspace: workspaceId,
name: change.path.split(path.sep)[1],
name: change.path.split(SEP)[1],
});
break;
case "resource":