Page 1 of 3

Backup File

Posted: 24.02.2023 13:42
by Stefan
Standing ovations for this plugin. Incredibly well done and thought-through. The naming options for backup files are mind-blowing. A writer's dream come true. :idea: 8-)

I love the direct access to the Compare-function, to see current and previous versions side by side. Is there a way to make it portable? Without hard-coding the WinMerge path?

This does not seem to work:

Code: Select all

 "diff": "\"{AppDrive}\\Toolbox\\WinMerge\\WinMergePortable.exe\" \"{COPY_PATH}\" \"{FILE_PATH}\"",
I also tried to call the Cuda-Differ plugin, which would make it portable by default, but could not pull it off. What would the command syntax look like in the above line, when I want to replace WinMerge with Cuda-Differ?

Posted: 24.02.2023 13:55
by main Alexey
Differ usage here is NOT possible (it is not the command line tool).
About hard coded WinMerge name:
this part of code does it

Code: Select all

        self.def_diff   = r'"c:\Program Files (x86)\WinMerge\WinMergeU.exe" "{COPY_PATH}" "{FILE_PATH}"' \
                            if os.name=='nt' else \
                          r'diff -u "{COPY_PATH}" "{FILE_PATH}"'
I dont see any config-option to change it..

Posted: 24.02.2023 15:07
by Stefan
Hm, I don't understand this code, but won't matter, as long as it works.
Where does it go? Into \settings\cuda_backup_file.json?

I suppose, I replace the c:\Program Files (x86) with my d:\Toolbox…? Since I carry WinMerge with me on the stick. But wouldn't that be hard-coded again? d:\Toolbox — the drive letter is bound to change, depending on the host system.

Posted: 24.02.2023 15:32
by main Alexey
not into \settings\cuda_xxxxx, it was code in python, part of the code. from file __init__.py. i can only tell you that you can fix the python code. :( sad, coz you need to do it after EVERY plugin update.

Posted: 24.02.2023 15:34
by main Alexey
we need to support new 'macro' like {CUDATEXT_DIR}. maybe will do it later...

Posted: 24.02.2023 15:57
by Stefan
You already have {AppDir} and {AppDrive}.
But I see what you mean, it does not work everywhere. For example, I was not able to use it in "ui_initial_dir"
It does work fine with my external tools, though: {AppDir}..\..\WinMerge\WinMergePortable.exe ...
main Alexey wrote:it was code in python, part of the code. from file __init__.py
Thank you. Will give it a try.
Should you decide to include {CUDATEXT_DIR}, all the better. Until then, I have portable WinMerge set up as an external tool. And I can always call up Differ and browse for the backup-file. No big deal.

The backup plugin is a really GREAT plugin nonetheless. Extremely useful.

Posted: 24.02.2023 16:08
by main Alexey
>You already have {AppDir} and {AppDrive}.

Where do i have them??? I cannot find them in BackupFile. (each plugin has its own macros)
I want to support {APP_DIR} and {APP_DRIVE}.

Posted: 24.02.2023 16:24
by main Alexey
Stefan, it is good idea to support 'macros' in the opt "ui_initial_dir".
beta is updated!

+ add: option "ui_initial_dir" supports macros: {AppDir}, {AppDrive}

Posted: 24.02.2023 17:07
by Stefan
Sorry for creating confusion. I was not aware that each plugin has its own {Macros}. My mind still operates in Synwrite mode (the old SW, where external tools was not a plugin), and since I had used {AppDir} quite a bit recently, configuring my ui ... — but ofc, you are right, it was always related to external tools.

Anyway, I welcome the addition of {AppDir} and {AppDrive} to "ui_initial_dir".

One of the many strong points of both, Syn and Cud, is their portable design. While many apps only claim to be portable, Syn and Cud really are. A big plus.

Posted: 24.02.2023 17:11
by main Alexey
Thanks :)
Test also the plugin update from me!

- remove BackupFile plugin
- call 'plugins / addons manager / install from Git'
- enter URL https://github.com/CudaText-addons/cuda_backup_file
- restart Cud

now test new 2 macros. {APP_DIR} / {APP_DRIVE}.
if all works, i will call Kvichans.