gotify / gotify/cli

./cli.json on windows executable resolves to current working directory instead of path relative to .exe.

Abierto
#3 7 comentarios 0 reacciones 0 asignados Ver en GitHub
a:feature good first issue
Lenguaje dominante
Go
Estrellas
588
Forks
73
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

After running `init` and selecting to save the configs to `./cli.json` the executable is unable to find the config file unless the console working directory is the executable's directory. In fact, I believe the `./cli.json` file is saved to whichever working directory you have active when `init`is run.

Not sure if this is the intended functionality but I expected it to save to the same directory as the `.exe` file and to always be loaded from there regardless of my working directory.

As a temporary fix I created a batch script that I am using to call the cli app from anywhere with the expected behavior. I'm posting it here in case anyone finds this thread and needs an immediate fix.

```
gotify.bat
-----------------
@echo off
pushd %~dp0
Call %~dp0\gotify-cli-windows-amd64.exe p -q %*
popd
```
The scripts needs to be placed on the same directory as the executable to work as is.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start at the init flow and the executable's config-loading path, focusing on how ./cli.json is resolved on Windows. Reproduce the behavior from a different working directory and confirm that the config is saved and loaded relative to the .exe directory when the issue is fixed.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
go
Área
cli
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.