From 19ab924fa233a49b9cd533c01c46dfded455583c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 25 Nov 2023 16:57:13 +0100 Subject: [PATCH] improve cli sync --- cli/flow.ts | 2 +- cli/script.ts | 18 +++++++++++------- cli/sync.ts | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cli/flow.ts b/cli/flow.ts index 4baa5bcf9a..f7e73dcda7 100644 --- a/cli/flow.ts +++ b/cli/flow.ts @@ -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}...`)); diff --git a/cli/script.ts b/cli/script.ts index 79d2f62f45..3076c570b5 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -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; } } diff --git a/cli/sync.ts b/cli/sync.ts index eff9c00e96..8b0f39201a 100644 --- a/cli/sync.ts +++ b/cli/sync.ts @@ -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}.` ) ); }