Skip to content

Commit

Permalink
Target/source of app upload|download command should be arg, not flag
Browse files Browse the repository at this point in the history
Fixes #394
  • Loading branch information
martin-helmich committed Sep 4, 2024
1 parent 0855c6e commit a30d42d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions src/commands/app/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
makeProcessRenderer,
processFlags,
} from "../../rendering/process/process_flags.js";
import { Flags } from "@oclif/core";
import { Args } from "@oclif/core";
import { Success } from "../../rendering/react/components/Success.js";
import { ReactNode } from "react";
import { getSSHConnectionForAppInstallation } from "../../lib/resources/ssh/appinstall.js";
Expand All @@ -30,21 +30,22 @@ export class Download extends ExecRenderBaseCommand<typeof Download, void> {
filterFileDocumentation;
static args = {
...appInstallationArgs,
target: Args.directory({
description: "target directory to download the app installation to",
required: true,
exists: false,
}),
};
static flags = {
...processFlags,
...sshConnectionFlags,
...appInstallationSyncFlags("download"),
target: Flags.directory({
description: "target directory to download the app installation to",
required: true,
exists: false,
}),
};

protected async exec(): Promise<void> {
const appInstallationId = await this.withAppInstallationId(Download);
const { "dry-run": dryRun, target, "ssh-user": sshUser } = this.flags;
const { "dry-run": dryRun, "ssh-user": sshUser } = this.flags;
const { target } = this.args;

const p = makeProcessRenderer(this.flags, "Downloading app installation");

Expand Down
15 changes: 8 additions & 7 deletions src/commands/app/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
makeProcessRenderer,
processFlags,
} from "../../rendering/process/process_flags.js";
import { Flags } from "@oclif/core";
import { Args } from "@oclif/core";
import { Success } from "../../rendering/react/components/Success.js";
import { ReactNode } from "react";
import { getSSHConnectionForAppInstallation } from "../../lib/resources/ssh/appinstall.js";
Expand All @@ -31,21 +31,22 @@ export class Upload extends ExecRenderBaseCommand<typeof Upload, void> {
filterFileDocumentation;
static args = {
...appInstallationArgs,
source: Args.directory({
description: "source directory from which to upload the app installation",
required: true,
exists: true,
}),
};
static flags = {
...processFlags,
...sshConnectionFlags,
...appInstallationSyncFlags("upload"),
source: Flags.directory({
description: "source directory from which to upload the app installation",
required: true,
exists: true,
}),
};

protected async exec(): Promise<void> {
const appInstallationId = await this.withAppInstallationId(Upload);
const { "dry-run": dryRun, source, "ssh-user": sshUser } = this.flags;
const { "dry-run": dryRun, "ssh-user": sshUser } = this.flags;
const { source } = this.args;

const p = makeProcessRenderer(this.flags, "Uploading app installation");

Expand Down

0 comments on commit a30d42d

Please sign in to comment.