Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Update account cmd and documentation

Neeraj Guptafd7aac9b443f
diff --git a/README.md b/README.md
index 287a14b85e..641213f1fd 100644
--- a/README.md
+++ b/README.md
@@ -15,8 +15,17 @@
```shell
ente-cli account list
```
+
+* Change export directory
+ ```shell
+ ente-cli account update --email [email protected] --dir ~/photos
+ ```
-
+## Export
+* Start export
+ ```shell
+ ente-cli export
+ ```
## Testing
diff --git a/cmd/account.go b/cmd/account.go
index db4bca3a77..5704a4de74 100644
--- a/cmd/account.go
+++ b/cmd/account.go
@@ -44,7 +44,12 @@ var updateAccCmd = &cobra.Command{
app, _ := cmd.Flags().GetString("app")
email, _ := cmd.Flags().GetString("email")
if email == "" {
- fmt.Printf("email must be specified")
+ fmt.Println("email must be specified")
+ return
+ }
+ if exportDir == "" {
+ fmt.Println("dir param must be specified")
+ return
}
validApps := map[string]bool{
@@ -72,7 +77,7 @@ func init() {
// Add 'config' subcommands to the root command
rootCmd.AddCommand(accountCmd)
// Add 'config' subcommands to the 'config' command
- updateAccCmd.Flags().String("dir", "", "Update export directory")
+ updateAccCmd.Flags().String("dir", "", "update export directory")
updateAccCmd.Flags().String("email", "", "email address of the account to update")
updateAccCmd.Flags().String("app", "photos", "Specify the app, default is 'photos'")
accountCmd.AddCommand(listAccCmd, addAccCmd, updateAccCmd)
diff --git a/pkg/account.go b/pkg/account.go
index 7d5524f97b..7ba7827380 100644
--- a/pkg/account.go
+++ b/pkg/account.go
@@ -154,7 +154,7 @@ func (c *ClICtrl) UpdateAccount(ctx context.Context, params model.UpdateAccountP
}
}
if acc == nil {
- return fmt.Errorf("account not found")
+ return fmt.Errorf("account not found, use `account list` to list accounts")
}
if params.ExportDir != nil && *params.ExportDir != "" {
_, err := internal.ValidateDirForWrite(*params.ExportDir)
diff --git a/pkg/sync.go b/pkg/sync.go
index f0b822d14e..2fb0f6c012 100644
--- a/pkg/sync.go
+++ b/pkg/sync.go
@@ -2,6 +2,7 @@ package pkg
import (
"cli-go/internal"
+ "cli-go/internal/api"
"cli-go/pkg/model"
"context"
"encoding/base64"
@@ -31,6 +32,10 @@ func (c *ClICtrl) Export() error {
log.Printf("Skip export, error: %v while validing exportDir %s\n", err, account.ExportDir)
continue
}
+ if account.App == api.AppAuth {
+ log.Printf("Skip account %s: auth export is not supported", account.Email)
+ continue
+ }
log.Println("start sync")
err = c.SyncAccount(account)
if err != nil {
diff --git a/release.sh b/release.sh
index f3886da41a..fb74e37318 100755
--- a/release.sh
+++ b/release.sh
@@ -24,6 +24,10 @@ do
if [ "$OS" == "darwin" ]; then
BINARY_NAME="ente-cli-mac"
fi
+
+ if [ "$OS" == "linux" ]; then
+ BINARY_NAME="ente-cli-linux"
+ fi
# make bin directory if it doesn't exist
mkdir -p bin