Added version info to entrypoint

This commit is contained in:
squidfunk 2023-09-20 17:59:51 +02:00
parent 69cd8c61ec
commit 1205411f22
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
3 changed files with 14 additions and 2 deletions

View File

@ -17,3 +17,5 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
__version__ = "9.3.2"

View File

@ -17,3 +17,5 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
__version__ = "$md-version$"

View File

@ -149,7 +149,7 @@ const assets$ = concat(
})),
/* Copy images and configurations */
...["**/*.{png,svg,yml}"]
...["**/*.{jpg,png,svg,yml}"]
.map(pattern => copyAll(pattern, {
from: "src",
to: base
@ -160,7 +160,15 @@ const assets$ = concat(
const sources$ = copyAll("**/*.py", {
from: "src",
to: base,
watch: process.argv.includes("--watch")
watch: process.argv.includes("--watch"),
transform: async (data, name) => {
if (path.basename(name) === "__init__.py") {
const metadata = require("../../package.json")
return data.replace("$md-version$", metadata.version)
} else {
return data
}
}
})
/* ------------------------------------------------------------------------- */