From 70cbf752bf6f4f9347c828eef0321fd40b313efc Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Tue, 27 Feb 2024 15:30:42 +0100 Subject: [PATCH] Fix documentation --- README.md | 19 +++++++++++++------ src/commands/app/upload.tsx | 34 ++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index a4c37e1cf..95ce78e6c 100644 --- a/README.md +++ b/README.md @@ -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= (required) source directory from which to upload the app installation --ssh-user= 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. @@ -2409,7 +2410,7 @@ Imports a dump of a MySQL database ``` USAGE - $ mw database mysql import DATABASE-ID -i [-q] [-p ] [--temporary-user] [--ssh-user ] + $ mw database mysql import DATABASE-ID -i [-q] [-p ] [--temporary-user] [--ssh-user ] [--gzip] ARGUMENTS DATABASE-ID The ID of the database (when a project context is set, you can also use the name) @@ -2418,6 +2419,7 @@ FLAGS -i, --input= (required) the input file from which to read the dump ("-" for stdin) -p, --mysql-password= 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= 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 @@ -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= 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 diff --git a/src/commands/app/upload.tsx b/src/commands/app/upload.tsx index 900a4007b..c0fb37872 100644 --- a/src/commands/app/upload.tsx +++ b/src/commands/app/upload.tsx @@ -15,9 +15,9 @@ import { sshConnectionFlags } from "../../lib/ssh/flags.js"; export class Upload extends ExecRenderBaseCommand { 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, @@ -26,17 +26,17 @@ export class Upload extends ExecRenderBaseCommand { ...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, }), }; @@ -89,20 +89,22 @@ export class Upload extends ExecRenderBaseCommand { [...rsyncOpts, source, `${user}@${host}:${directory}/`], ); - if (dryRun) { - await p.complete( - - App would (probably) have successfully been uploaded. 🙂 - , - ); - } else { - await p.complete( - App successfully uploaded; have fun! 🚀, - ); - } + await p.complete(); } protected render(): ReactNode { return undefined; } } + +function UploadSuccess({ dryRun }: { dryRun: boolean }) { + if (dryRun) { + return ( + + App would (probably) have successfully been uploaded. 🙂 + + ); + } + + return App successfully uploaded; have fun! 🚀; +}