Portable Mode not working #21
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
At least on windows, it seems to always load the config from AppData\Roaming\Gropple\config.yml, even if theres already a config.yml in the same folder as gropple.exe
How are you executing gropple.exe? The code is currently looking in the "current directory" - not "directory the binary is in" - is that the problem?
No matter what I do, I seem unable to have it access the settings in the
current directory / or directory the gropple exe is in.
I've tried via search everything, windows explorer, and via command prompt:
FWIW, I've never seen a portable app on windows look for settings relative
to or in the "current" directory, and not the directory the exe is in.
Never even occurred to me that it might work that way.
Microsoft Windows [Version 10.0.22621.1265]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Jolly>cd c:\ccdc\PortableApps\gropple
c:\ccdc\PortableApps\Gropple>dir *.yml
Volume in drive C has no label.
Volume Serial Number is 8E2B-8CD8
Directory of c:\ccdc\PortableApps\Gropple
01/11/2023 12:10 AM 693 config.yml
1 File(s) 693 bytes
0 Dir(s) 903,394,631,680 bytes free
c:\ccdc\PortableApps\Gropple>
c:\ccdc\PortableApps\Gropple>gropple.exe
2023/03/07 03:34:38 Starting gropple v0.5.5 -
https://github.com/tardisx/gropple
2023/03/07 03:34:38 Configuration loaded from
C:\Users\Jolly\AppData\Roaming\gropple\config.yml
2023/03/07 03:34:38 Visit http://localhost:25222 for details on installing
the bookmarklet and to check status
On Tue, Mar 7, 2023 at 2:34 AM Justin Hawkins @.***>
wrote:
One other thing to note - it looks for yt-dlp in the output directory, not
in the directory with gropple.exe
On Tue, Mar 7, 2023 at 3:37 AM Jolly @.***> wrote:
Thanks for the follow up info - it's very useful.
Firstly, it definitely doesn't look for yt-dlp in the output directory. If interested, see
c1c1fc1866/config/config.go (L172)where gropple runs your executable, and where it is checked to see if it is on your path (or fully qualified). You may not be running the yt-dlp executable you think you are, or your path is unusual.That said, looking at https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory which was a change in Go 1.19. Since the most recent Gropple was compiled with an older version (1.16) it could be that it is seeing yt-dlp in your current directory, even if it's not on your path. That would explain what you're seeing - you start gropple in your output folder, yt-dlp is there, and you have the command configured as just "yt-dlp". I will update to Go 1.20 next release, so don't rely on this behaviour, as the link documents it is a security problem.
To be clear, this is completely unrelated to config file handling.
Re: loading the config from the binary directory instead of the current directory - agreed this is incorrect. I don't use windows nor have a need for a portable binary so it has not had more than a cursory look. I agree even the current incorrect behaviour should work in your case that you pasted. I will leave this open to change it to look in the binary directory - that definitely makes more sense and I can't imagine anyone is usefully using the current broken behaviour.
Can you see if the latest version fixes your problem:
https://github.com/tardisx/gropple/releases/tag/v0.6.0-alpha.2
Note - it's an alpha release and some stuff may be broken.
Please note, when looking for a portable config, the filename is "gropple.yml" - not "config.yml". This would have been why it did not work for you even in the current directory.
Latest version works!
(I was a bit surprised about it looking for gropple.yml though, I would have assumed the config file would be named the same regardless of location)
Thanks for testing!
The reason for the name change is that in normal mode the config.yaml file is stored in a folder named "gropple".
In portable mode, a generic name might not obviously go with the exe, or worse, might clash with some other portable exe in the same directory.