fix: wmill app push <path_to_app_file> (#3024)

This commit is contained in:
Guillaume Bouvignies
2024-01-17 14:59:48 +01:00
committed by GitHub
parent 9edbba052a
commit ae8f56a930
+4 -15
View File
@@ -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<void> {
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"));