Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gonb CLI version #158

Closed
tonidy opened this issue Jan 29, 2025 · 4 comments
Closed

gonb CLI version #158

tonidy opened this issue Jan 29, 2025 · 4 comments

Comments

@tonidy
Copy link
Contributor

tonidy commented Jan 29, 2025

While debugging this issue (dotnet/interactive#3511), I noticed that gonb -version does not exist, even though we have %version. Can we add a CLI version option?

$ gonb -version
flag provided but not defined: -version
Usage of gonb:
  -add_dir_header
        If true, adds the file directory to the header of the log messages

I’ve attempted to create a version parameter:

Long version

Image

Short version

Image

If this looks good, then I'll go ahead and create a PR.

@janpfeifer
Copy link
Owner

These look awesome.!

You may as well change the %version to look the same :)

@tonidy
Copy link
Contributor Author

tonidy commented Jan 29, 2025

I've made this PR #160. I'd appreciate your review 😄 .

Here is the updated %version in the notebook:

Image

And here is the updated CLI version:

Image

@janpfeifer janpfeifer mentioned this issue Feb 2, 2025
@janpfeifer
Copy link
Owner

v0.10.11 is released with the new --version, -V and %version, and some other small fixes.

I changed it to pick the version number not from the git current tag, but from a verstion.txt file. Otherwise, I had to commit the updated version number after I did git tag, and then I would have to correct again the tag to the new commit. Instead, now version.txt is the source of truth, and I always do git tag $(cat version.txt) -- if you know of a better way, pls let me know.

Thanks again @tonidy

Btw, would you be interested in implementing #159 as well ?

cheers

@tonidy
Copy link
Contributor Author

tonidy commented Feb 3, 2025

v0.10.11 is released with the new --version, -V and %version, and some other small fixes.

Congratulations on new release 🥳 , I noticed when updating to gonb v0.10.11, the version control info was missing.

I changed it to pick the version number not from the git current tag, but from a verstion.txt file. Otherwise, I had to commit the updated version number after I did git tag, and then I would have to correct again the tag to the new commit. Instead, now version.txt is the source of truth, and I always do git tag $(cat version.txt) -- if you know of a better way, pls let me know.

Usually I just added git tag and then build the binary, so go will use debug.ReadBuildInfo and read the build information. I think gonb has different way, actually I made this branch https://github.com/tonidy/gonb/tree/test-git-archive, you might look into the source code and testing it locally.

Thanks again @tonidy

No worries mate, I hope my contribution will benefit to the community.

Btw, would you be interested in implementing #159 as well ?

I'll check into that issue when I've some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants