Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Feb 27, 2024
1 parent 7547d66 commit 70cbf75
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1555,17 +1555,18 @@ ARGUMENTS
FLAGS
-q, --quiet suppress process output and only display a machine-readable summary.
--delete delete local files that are not present on the server
--dry-run do not actually download the app installation
--delete delete remote files that are not present locally
--dry-run do not actually upload the app installation
--source=<value> (required) source directory from which to upload the app installation
--ssh-user=<value> override the SSH user to connect with; if omitted, your own user will be used
DESCRIPTION
Upload the filesystem of an app to a project
Upload the filesystem of an app from your local machine to a project.CAUTION: This is a potentially destructive
operation. It will overwrite files on the server with the files from your local machine.This is NOT a turnkey
deployment solution. It is intended for development purposes only.
Upload the filesystem of an app from your local machine to a project.
CAUTION: This is a potentially destructive operation. It will overwrite files on the server with the files from your
local machine. This is NOT a turnkey deployment solution. It is intended for development purposes only.
FLAG DESCRIPTIONS
-q, --quiet suppress process output and only display a machine-readable summary.
Expand Down Expand Up @@ -2409,7 +2410,7 @@ Imports a dump of a MySQL database

```
USAGE
$ mw database mysql import DATABASE-ID -i <value> [-q] [-p <value>] [--temporary-user] [--ssh-user <value>]
$ mw database mysql import DATABASE-ID -i <value> [-q] [-p <value>] [--temporary-user] [--ssh-user <value>] [--gzip]
ARGUMENTS
DATABASE-ID The ID of the database (when a project context is set, you can also use the name)
Expand All @@ -2418,6 +2419,7 @@ FLAGS
-i, --input=<value> (required) the input file from which to read the dump ("-" for stdin)
-p, --mysql-password=<value> the password to use for the MySQL user (env: MYSQL_PWD)
-q, --quiet suppress process output and only display a machine-readable summary.
--gzip uncompress the dump with gzip
--ssh-user=<value> override the SSH user to connect with; if omitted, your own user will be used
--[no-]temporary-user create a temporary user for the dump
Expand All @@ -2440,6 +2442,11 @@ FLAG DESCRIPTIONS
This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
scripts), you can use this flag to easily get the IDs of created resources for further processing.
--gzip uncompress the dump with gzip
Uncompress the dump with gzip while importing. This is useful for large databases, as it can significantly reduce
the size of the dump.
--ssh-user=<value> override the SSH user to connect with; if omitted, your own user will be used
This flag can be used to override the SSH user that is used for a connection; be default, your own personal user
Expand Down
34 changes: 18 additions & 16 deletions src/commands/app/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { sshConnectionFlags } from "../../lib/ssh/flags.js";
export class Upload extends ExecRenderBaseCommand<typeof Upload, void> {
static summary = "Upload the filesystem of an app to a project";
static description =
"Upload the filesystem of an app from your local machine to a project." +
"Upload the filesystem of an app from your local machine to a project.\n\n" +
"" +
"CAUTION: This is a potentially destructive operation. It will overwrite files on the server with the files from your local machine." +
"CAUTION: This is a potentially destructive operation. It will overwrite files on the server with the files from your local machine. " +
"This is NOT a turnkey deployment solution. It is intended for development purposes only.";
static args = {
...appInstallationArgs,
Expand All @@ -26,17 +26,17 @@ export class Upload extends ExecRenderBaseCommand<typeof Upload, void> {
...processFlags,
...sshConnectionFlags,
"dry-run": Flags.boolean({
description: "do not actually download the app installation",
description: "do not actually upload the app installation",
default: false,
}),
delete: Flags.boolean({
description: "delete local files that are not present on the server",
description: "delete remote files that are not present locally",
default: false,
}),
source: Flags.directory({
description: "source directory from which to upload the app installation",
required: true,
exists: false,
exists: true,
}),
};

Expand Down Expand Up @@ -89,20 +89,22 @@ export class Upload extends ExecRenderBaseCommand<typeof Upload, void> {
[...rsyncOpts, source, `${user}@${host}:${directory}/`],
);

if (dryRun) {
await p.complete(
<Success>
App would (probably) have successfully been uploaded. πŸ™‚
</Success>,
);
} else {
await p.complete(
<Success>App successfully uploaded; have fun! πŸš€</Success>,
);
}
await p.complete(<UploadSuccess dryRun={dryRun} />);
}

protected render(): ReactNode {
return undefined;
}
}

function UploadSuccess({ dryRun }: { dryRun: boolean }) {
if (dryRun) {
return (
<Success>
App would (probably) have successfully been uploaded. πŸ™‚
</Success>
);
}

return <Success>App successfully uploaded; have fun! πŸš€</Success>;
}

0 comments on commit 70cbf75

Please sign in to comment.