Skip to content

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

Description

@Claudiohbsantos

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 initis 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions