Skip to content

Commit dfc6e2a

Browse files
committed
Set default current path as default in GDrive Upload
1 parent 7392e7b commit dfc6e2a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ wp gdrive about
342342
### Upload Files or Folder
343343

344344
```console
345-
wp gdrive upload <path> [<UploadTo>] [--name=<file_name>] [--zip] [--force]
345+
wp gdrive upload [<path>] [<UploadTo>] [--name=<file_name>] [--zip] [--force]
346346
```
347347

348348
path
349-
: The path of file or folder for Upload.
349+
: The path of file or folder for Upload. `default is current path`
350350

351351
UploadTo
352352
: The path dir where the file will be saved in Google Drive.
@@ -362,6 +362,12 @@ UploadTo
362362

363363
---
364364

365+
Automatic create zip file archive file from all root directory and files and upload to GDrive:
366+
367+
```console
368+
wp gdrive upload --zip
369+
```
370+
365371
Upload backup.zip file to root dir in Google Drive:
366372

367373
```console

src/Gdrive_Command.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ function get($_, $assoc)
972972
*
973973
* ## OPTIONS
974974
*
975-
* <path>
975+
* [<path>]
976976
* : The path of file or folder for Upload.
977977
*
978978
* [<UploadTo>]
@@ -1040,6 +1040,9 @@ function upload($_, $assoc)
10401040
}
10411041

10421042
// Prepare File Path
1043+
if ( ! isset($_[0])) {
1044+
$_[0] = "/";
1045+
}
10431046
$file_path = \WP_CLI_FileSystem::path_join(WP_CLI_Util::getcwd(), WP_CLI_Google_Drive::sanitize_path(trim($_[0])));
10441047
if ( ! file_exists($file_path)) {
10451048
WP_CLI_Helper::pl_wait_end();

0 commit comments

Comments
 (0)