From ae8f56a93053b349cec320dc8d6b98dd1c7a69e7 Mon Sep 17 00:00:00 2001 From: Guillaume Bouvignies Date: Wed, 17 Jan 2024 14:59:48 +0100 Subject: [PATCH] fix: wmill app push (#3024) --- cli/apps.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/cli/apps.ts b/cli/apps.ts index 6e5afbc9f8..63c2e27a8a 100644 --- a/cli/apps.ts +++ b/cli/apps.ts @@ -24,13 +24,13 @@ export interface AppFile { export async function pushApp( workspace: string, - remotePath: string, - app: AppFile | AppWithLastVersion | undefined, + filePath: string, newApp: AppFile, message?: string ): Promise { - remotePath = removeType(remotePath, "app"); + const remotePath = removeType(filePath, "app"); // deleting old app if it exists in raw mode + let app = undefined; try { app = await AppService.getAppByPath({ workspace, @@ -102,20 +102,9 @@ async function push(opts: GlobalOptions, filePath: string) { const workspace = await resolveWorkspace(opts); await requireLogin(opts); - let app: AppWithLastVersion | undefined = undefined; - try { - app = await AppService.getAppByPath({ - workspace: workspace.workspaceId, - path: remotePath, - }); - } catch { - // app doesn't exist - } - await pushApp( workspace.workspaceId, - remotePath, - app, + filePath, parseFromFile(filePath) ); console.log(colors.bold.underline.green("App pushed"));