improve cli sync

This commit is contained in:
Ruben Fiszel
2023-11-25 16:57:13 +01:00
parent bae0f45f21
commit 19ab924fa2
3 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ export async function pushFlow(
if (flow) {
if (isSuperset(localFlow, flow)) {
log.info(colors.bold.green("Flow is up to date"));
log.info(colors.green(`Flow ${remotePath} is up to date`));
return;
}
log.info(colors.bold.yellow(`Updating flow ${remotePath}...`));
+11 -7
View File
@@ -124,14 +124,18 @@ export async function handleFile(
typed.is_template === remote.is_template &&
typed.kind == remote.kind &&
!remote.archived &&
remote?.lock == typed.lock?.join("\n") &&
JSON.stringify(typed.schema) == JSON.stringify(remote.schema))
(remote?.lock ?? "") == (typed.lock?.join("\n") ?? "") &&
JSON.stringify(typed.schema) == JSON.stringify(remote.schema) &&
typed.tag == remote.tag &&
(typed.ws_error_handler_muted ?? false) ==
remote.ws_error_handler_muted &&
typed.dedicated_worker == remote.dedicated_worker &&
typed.cache_ttl == remote.cache_ttl &&
typed.concurrency_time_window_s ==
remote.concurrency_time_window_s &&
typed.concurrent_limit == remote.concurrent_limit)
) {
log.info(
colors.yellow(
`No change to push for script ${remotePath}, skipping`
)
);
log.info(colors.green(`Script ${remotePath} is up to date`));
return true;
}
}
+4 -4
View File
@@ -561,8 +561,8 @@ async function pull(
}
}
log.info(
colors.green.underline(
`Done! All ${changes.length} changes applied locally.`
colors.bold.green.underline(
`\nDone! All ${changes.length} changes applied locally.`
)
);
}
@@ -831,8 +831,8 @@ async function push(
}
}
log.info(
colors.green.underline(
`Done! All ${changes.length} changes pushed to the remote workspace ${workspace.workspaceId} named ${workspace.name}.`
colors.bold.green.underline(
`\nDone! All ${changes.length} changes pushed to the remote workspace ${workspace.workspaceId} named ${workspace.name}.`
)
);
}