Hi Piotr,
> <mailto:
stefan...@swupdate.org>> napisał(a):
>
> Hi Piotr,
>
> On 11/17/25 13:11, Piotr Piwko wrote:
> > Hi,
> >
> > I have a simple sw-description file like this:
> >
> > software =
> > {
> > version = "1.0.0"
> > embedded-script = "
> > swupdate.warn(\"new version: \" .. version)
> > "
> > ...
> > }
> >
> > I would like to access the version field inside the Lua script,
> but all
> > my attempts have failed. Could someone point me to documentation
> or an
> > example that describes how to do this?
>
> Version is exposed by SWUpdate:
>
> embedded-script = "
> require('swupdate')
> swupdate.warn(\"new version: \" .. swupdate.getversion)
>
>
> It returns the swupdate's version (2024.0), not the content of the
> `version` field in sw-description (in my example 1.0.0).
Yes, you're right, I misunderstood.
There is currently no access to global attributes (like "version"). It
is not a big deal to add it, but it is currently unsupported. Versions
are likely managed by the core, and there wasn't yet a use case to add
an interface here.
Best regards,
Stefano Babic
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate%2Bunsu...@googlegroups.com>.
> <
https://groups.google.com/d/msgid/swupdate/21d8c957-094d-4f3f-
> a181-4f25e2d70dcc%
40swupdate.org>.
>
>
>
> --
> Piotr Piwko
>
https://www.piotrpiwko.com/ <
https://www.piotrpiwko.com/>
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> swupdate/CAMTWR-PHv-
> aRP%2BDfnWSZbKwZ0VKJNP6W6jhpusC%3DkvsXfhJUpw%
40mail.gmail.com <https://
>
groups.google.com/d/msgid/swupdate/CAMTWR-PHv-
> aRP%2BDfnWSZbKwZ0VKJNP6W6jhpusC%3DkvsXfhJUpw%
40mail.gmail.com?
> utm_medium=email&utm_source=footer>.