enonic / cli-enonic

GNU General Public License v3.0
41 stars 1 forks source link

Enonic dump operations do not work on remote hosts #287

Open gbbirkisson opened 3 years ago

gbbirkisson commented 3 years ago

It tries to read some local directories that are not present instead of calling the remote XP server.

$ enonic dump ls
Error reading dumps folder: open data/dump: no such file or directory
alansemenov commented 3 years ago

@gbbirkisson You have set environment variables, right?

gbbirkisson commented 3 years ago

Yes I have.

All dump operations use this function ensureNameFlag:

https://github.com/enonic/cli-enonic/blob/14833d589c5021624a6da62b7d9c9168346c526e/internal/app/commands/dump/dump.go#L23-L24

And that function never calls the remote server:

https://github.com/enonic/cli-enonic/blob/14833d589c5021624a6da62b7d9c9168346c526e/internal/app/commands/dump/list.go#L30-L44

pmi commented 3 years ago

It tries to read some local directories that are not present instead of calling the remote XP server.

$ enonic dump ls
Error reading dumps folder: open data/dump: no such file or directory

XP remote API simply does not have list command cuz there is no way for it can list local dump files. So CLI is just being clever and just scans the local folder for previous dumps.