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

gno {build,test,publish} -X (initialization parameters) #1021

Open
moul opened this issue Aug 3, 2023 · 3 comments
Open

gno {build,test,publish} -X (initialization parameters) #1021

moul opened this issue Aug 3, 2023 · 3 comments
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors help wanted Want to contribute? We recommend these issues.

Comments

@moul
Copy link
Member

moul commented Aug 3, 2023

Like go build -X and go install -X, this feature in gno allows you to override variables during build, test, and publish operations. For instance:

var myVar string = "default"
$ gno {build,test,publish} -X myVar=override
...

As a result, the file is patched when parsed into MemFile, reflecting the overridden value for myVar.

Related with #1017

@moul
Copy link
Member Author

moul commented Aug 3, 2023

cc @go7066

@moul moul changed the title gno {build,test,publish} -X gno {build,test,publish} -X (initialization parameters) Aug 3, 2023
@moul moul added 🗺️good first issue🗺️ Ideal for newcomer contributors help wanted labels Aug 3, 2023
@go7066
Copy link

go7066 commented Aug 7, 2023

This won't be working for gnokey addpkg in that case, but would only work with gno publish -X myVar=override.
The deployed code will have the static variable stored on the code right?

@moul
Copy link
Member Author

moul commented Aug 9, 2023

Yes, gnokey stays minimal, gno can have more logic.

Yes, basically, .gno files are patched before publish.

@moul moul moved this to 🔵 Not Needed for Launch in 🚀 The Launch [DEPRECATED] Sep 5, 2023
@moul moul added this to the 💡Someday/Maybe milestone Sep 6, 2023
@moul moul moved this to Todo in 💪 Bounties & Worx Dec 22, 2023
@Kouteki Kouteki added help wanted Want to contribute? We recommend these issues. and removed help wanted labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors help wanted Want to contribute? We recommend these issues.
Projects
Status: Todo
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

3 participants