Do you mean you want to run it from a USB stick or similar
yes
On multiple machines?
yes
> Do you mean you want to run it from a USB stick or similar
yes
> On multiple machines?
yes

as this isn't answered (yet?), i suggest to edit 'config.go' lines 164 to 183 as followed:
original:
`func configPath() string {
dir, err := os.UserConfigDir()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
appDir := "gropple"
fullPath := dir + string(os.PathSeparator) + appDir
_, err = os.Stat(fullPath)
if os.IsNotExist(err) {
err := os.Mkdir(fullPath, 0777)
if err != nil {
log.Fatalf("Could not create config dir %s : %v", fullPath, err)
}
}
fullFilename := fullPath + string(os.PathSeparator) + "config.yml"
return fullFilename
}`
edited version:
`func configPath() string {
dir, err := os.Executable()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
// if you want to place config.yml in a subdir of the Current workdit of your .exe
// edit the // appDir := "config" line and remove the // infront of it, and place // infront of the appDir:="" line
// if you want to place config.yml next to your exe, leave the following 2 lines as shown
// appDir := "config"
appDir := ""
if appDir != "" {
fullPath := dir + string(os.PathSeparator) + appDir
} else {
fullPath := dir
}
_, err = os.Stat(fullPath)
if os.IsNotExist(err) {
err := os.Mkdir(fullPath, 0777)
if err != nil {
log.Fatalf("Could not create config dir %s: %v", fullPath, err)
}
}
fullFilename := fullPath + string(os.PathSeparator) + "config.yml"
return fullFilename
}`
ps: this is untested, and like a first Golang-edit for me, but that should do would you want.
as this isn't answered (yet?), i suggest to edit 'config.go' lines 164 to 183 as followed:
original:
`func configPath() string {
dir, err := os.UserConfigDir()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
appDir := "gropple"
fullPath := dir + string(os.PathSeparator) + appDir
_, err = os.Stat(fullPath)
if os.IsNotExist(err) {
err := os.Mkdir(fullPath, 0777)
if err != nil {
log.Fatalf("Could not create config dir %s : %v", fullPath, err)
}
}
fullFilename := fullPath + string(os.PathSeparator) + "config.yml"
return fullFilename
}`
edited version:
`func configPath() string {
dir, err := os.Executable()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
// if you want to place config.yml in a subdir of the Current workdit of your .exe
// edit the // appDir := "config" line and remove the // infront of it, and place // infront of the appDir:="" line
// if you want to place config.yml next to your exe, leave the following 2 lines as shown
// appDir := "config"
appDir := ""
if appDir != "" {
fullPath := dir + string(os.PathSeparator) + appDir
} else {
fullPath := dir
}
_, err = os.Stat(fullPath)
if os.IsNotExist(err) {
err := os.Mkdir(fullPath, 0777)
if err != nil {
log.Fatalf("Could not create config dir %s: %v", fullPath, err)
}
}
fullFilename := fullPath + string(os.PathSeparator) + "config.yml"
return fullFilename
}`
ps: this is untested, and like a first Golang-edit for me, but that should do would you want.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
why is
config.ymlnot saved in the same folder asgropple.exe?It's pretty standard behaviour to store a config file in $HOME or similar, so the binary can be anywhere. What's your use case?
how to save
config.ymlin a portable folder so it's easy to use gropple without config from scratch again.Do you mean you want to run it from a USB stick or similar? On multiple machines?
yes
yes

as this isn't answered (yet?), i suggest to edit 'config.go' lines 164 to 183 as followed:
original:
`func configPath() string {
dir, err := os.UserConfigDir()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
appDir := "gropple"
}`
edited version:
`func configPath() string {
dir, err := os.Executable()
if err != nil {
log.Fatalf("cannot find a directory to store config: %v", err)
}
}`
ps: this is untested, and like a first Golang-edit for me, but that should do would you want.
pfff code-block insert is sh**t, oh well you should be able to figure it out with the above info