Skip to content

Commit 1205411

Browse files
committed
Added version info to entrypoint
1 parent 69cd8c6 commit 1205411

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

material/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1818
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1919
# IN THE SOFTWARE.
20+
21+
__version__ = "9.3.2"

src/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1818
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1919
# IN THE SOFTWARE.
20+
21+
__version__ = "$md-version$"

tools/build/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const assets$ = concat(
149149
})),
150150

151151
/* Copy images and configurations */
152-
...["**/*.{png,svg,yml}"]
152+
...["**/*.{jpg,png,svg,yml}"]
153153
.map(pattern => copyAll(pattern, {
154154
from: "src",
155155
to: base
@@ -160,7 +160,15 @@ const assets$ = concat(
160160
const sources$ = copyAll("**/*.py", {
161161
from: "src",
162162
to: base,
163-
watch: process.argv.includes("--watch")
163+
watch: process.argv.includes("--watch"),
164+
transform: async (data, name) => {
165+
if (path.basename(name) === "__init__.py") {
166+
const metadata = require("../../package.json")
167+
return data.replace("$md-version$", metadata.version)
168+
} else {
169+
return data
170+
}
171+
}
164172
})
165173

166174
/* ------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)