./cli.json on windows executable resolves to current working directory instead of path relative to .exe.
- Ngôn ngữ chính
- Go
- Star
- 588
- Fork
- 73
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu từ luồng init và đường dẫn tải cấu hình của tệp thực thi, tập trung vào cách ./cli.json được phân giải trên Windows. Tái hiện hành vi từ một thư mục làm việc khác và xác nhận rằng cấu hình được lưu và tải tương đối so với thư mục .exe khi vấn đề được khắc phục.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100