Am i wrong that https://snapcraft.io/docs/environment-variables doesn’t show an option to ascertain the snap channel being used ATM?
I’d like to specify within a build if it was built via ‘edge’ or ‘candidate’ etc…
Am i wrong that https://snapcraft.io/docs/environment-variables doesn’t show an option to ascertain the snap channel being used ATM?
I’d like to specify within a build if it was built via ‘edge’ or ‘candidate’ etc…
Your comment about specifying it at built time suggests confusion: there’s no channel at build time, it is only meaningful after the build is uploaded to the store.
I don’t know of any environment variable that allows a snap to determine which channel (if any) it was installed from. And frankly, I don’t think it would be useful: knowing which build of the snap is far more important as that identifies the packaged software.
The same build could be installed from via channels or sideloaded and would behave the same. Similarly, the channel can deliver different builds at different times or on different architectures.
Channels like beta
(which we treat as a weekly) would be easier to differentiate from edge
which are daily. Just discerning from build number is not as efficient to recognize which is which because edge may have not updated or it was a slow development week.
But to your point, this doesn’t exist. It may be too much of an edgecase. But it makes sense to me that it could be useful in certain situations.