From 40d6daf8240f9dc090c23f975488c424b88f120f Mon Sep 17 00:00:00 2001 From: Goffert van Gool Date: Thu, 13 Dec 2018 22:16:58 +0100 Subject: Read version from Cargo.toml (#1267) --- build_extra/rust/get_cargo_info.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 build_extra/rust/get_cargo_info.py (limited to 'build_extra/rust/get_cargo_info.py') diff --git a/build_extra/rust/get_cargo_info.py b/build_extra/rust/get_cargo_info.py new file mode 100755 index 000000000..43c964ab7 --- /dev/null +++ b/build_extra/rust/get_cargo_info.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# Copyright 2018 the Deno authors. All rights reserved. MIT license. + +import sys +import re + +# Read the package version from Cargo.toml and output as json +cargo_toml_path = sys.argv[1] + +for line in open(cargo_toml_path): + match = re.search('version = "(.*)"', line) + if match: + print('{"version": "' + match.group(1) + '"}') + break -- cgit v1.2.3