gotify / gotify/cli

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

オープン
#3 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
a:feature good first issue
主要言語
Go
スター
588
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

init フローと実行ファイルの設定読み込みパスから始め、Windows で ./cli.json がどのように解決されるかに注目してください。別の作業ディレクトリからその動作を再現し、問題が修正されたときに設定が .exe ディレクトリを基準に保存および読み込まれることを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。