-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: locate config files on the folder where the executable is. #3136
Comments
You can already do this with |
I cannot explain properly at this time but there is something said about There is this batch file I wrote hours ago but there are still things I have not checked so I do not think it would be fine using it yet: @echo off
setlocal
set "pdir=%~dp0"
endlocal & "%pdir%micro.exe" -config-dir "%pdir:~0,-1%" %* |
"%pdir%micro.exe" -config-dir "%pdir:~0,-1%" %* Works without setlocal & endlocal. And using: echo "%CD%\micro.exe" -config-dir "%CD%" %* will achieve the same result. However, thank you very much for your help. |
That's fine, thank you! Consider implement something like "if the config file not exist on this folder, then use/create the %LOCALAPPDATA% location", it will be more simple for the users than be including the " -config-dir ." all the time.Keep up the great work, micro is awesome! |
\micro-2.0.13\internal\config\config.go
Do I have to change the ".config" to "filepath" for specify the executable location or on the line 31 just: |
I do not think the code can be changed like you asked because I think the lines can be replaced like this so that configuration files in the directory with the executable file only will be used if microHome := os.Getenv("MICRO_CONFIG_HOME")
if microHome == "" {
exe, err := os.Executable()
if err != nil {
return errors.New("Error getting path of executable\nCan't load config files: " + err.Error())
}
microHome = filepath.Dir(exe)
}
ConfigDir = microHome |
Thank you very much for you help and for create this awesome tool :) |
Hi, finally I got some time today and tried to build it, but with that modification it shows the following:
|
I think there was an error when building because By the way, I do not know if you were thinking that I created micro but I am not the one that created it. |
Ok, moving out the
So I removed that line from |
Hi, the program store its config files on %APPDATA%.config, and it would be awesome if were possible locate them (including the "buffers" folder) on the same folder where the program is, so this way it can be used as portable on a USB pendrive or whatever.
Cheers.
The text was updated successfully, but these errors were encountered: