mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
invoke from build.rs
This commit is contained in:
parent
13134a091b
commit
90fffe2410
9
editor/build.rs
Normal file
9
editor/build.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
assert!(Command::new("/usr/bin/python2")
|
||||
.args(&["extract_colorscheme.py"])
|
||||
.status()
|
||||
.unwrap()
|
||||
.success());
|
||||
}
|
@ -5,14 +5,14 @@ import os
|
||||
def run():
|
||||
mapping = {}
|
||||
|
||||
for path, _, files in os.walk('.'):
|
||||
for path, _, files in os.walk('src'):
|
||||
for f in files:
|
||||
if f.endswith('.rs') and f != 'colors.rs':
|
||||
for k, v in read_file(os.path.join(path, f)):
|
||||
# TODO Check for double-definitions
|
||||
mapping[k] = v
|
||||
|
||||
with open('init_colors.rs', 'w') as f:
|
||||
with open('src/init_colors.rs', 'w') as f:
|
||||
f.write('// AUTOGENERATED! Do not modify.\n')
|
||||
f.write('\n')
|
||||
f.write('use ezgui::Color;\n')
|
Loading…
Reference in New Issue
Block a user