tywil04 / slavartdl

Simple tool written in Go(lang) to download music using the SlavArt Divolt server
GNU General Public License v3.0
18 stars 1 forks source link

Error trying to list credentials #23

Closed bacon-cheeseburger closed 1 year ago

bacon-cheeseburger commented 1 year ago

Hi, I'm using Linux cli. I updated to latest master, created a clean test config and added credentials with:

slavartdl config add discordCredential -C "/tmp/test.json" discordlogin discordpassword slavartdl config add divoltCredential -C "/tmp/test.json" divoltlogin divoltpassword

Then I tried to list back the credentials and received an error:

$ slavartdl config list discordCredentials -C "/tmp/test.json" Error: unknown error with config Usage: slavartdl config list discordCredentials [flags]

Flags: -C, --configPath string a directory that contains an override config.json file or a file which contains an override config [a custom config file must end in .json] -h, --help help for discordCredentials

Not sure if there's a bug in reading/writing the config or something else. For reference, the package I created is _slavartdl_1.1.16-r140-git+5943f89amd64.deb. I haven't tested any further and reverted back to 1.1.15 for now.

tywil04 commented 1 year ago

When I run the exact same sequence of commands the credentials get printed out as expected, I am unsure as to why you are having an issue.

The only way I think an issue could have been caused is simple, an old version of the config didn't have the discordcredentials map stored, which means that it would have automatically tried to migrate the old config to the new config, however I assume something goes wrong here (I recently updated the code to automatically migrate the config) and it throws an error.

tywil04 commented 1 year ago

Can you try again using v1.1.17?

bacon-cheeseburger commented 1 year ago

Just compiled and tested master into a debian package: _slavartdl_1.1.17-r143-git+6fcf01damd64.deb

Credentials work now but I ran across something else.. When I check the version from the command line I get:

$ slavartdl version Version: v1.1.16

Not sure why that's internally showing 1.1.16. When I build the package I get the version with: git tag --list |sort -V |tail -1

tywil04 commented 1 year ago

This is a simple error on my part, when Im ready to publish a new release I should update the code so the version variable is displaying the next version. I have been meaning to find a better solution and I have now implemented that.

When building, you can now pass a release variable to be used. It is done automatically now with the automatic builds, but if you want to build manually, pass the following to go build:

-ldflags "-X github.com/tywil04/slavartdl/cli/internal/update.Version=VERSION_HERE"

I rebuilded v1.1.17 so if you download the latest release it will work display the correct version!

tywil04 commented 1 year ago

Just as a note, if you ever need to redownload a version you can simply run slavartdl update --force to force pull the latest prebuild release from GitHub. So if even the version numbers are the same, you are actually pulling the latest release.