1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 08:39:09 -05:00
denoland-deno/build_extra/rust/get_cargo_info.py

15 lines
378 B
Python
Raw Normal View History

2018-12-13 16:16:58 -05:00
#!/usr/bin/env python
2019-01-21 14:03:30 -05:00
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
2018-12-13 16:16:58 -05:00
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