mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-28 20:11:22 +00:00
add script to support update nodejs binding version (#4164)
This commit is contained in:
parent
4377ff4a1a
commit
2b3ce1b090
1 changed files with 14 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import json
|
||||
|
||||
|
||||
def update_version():
|
||||
|
|
@ -87,6 +88,19 @@ def update_version():
|
|||
continue
|
||||
f.write(line)
|
||||
|
||||
# update version for node.js binding
|
||||
current_version = ''
|
||||
file_names = ['package.json', 'package-lock.json']
|
||||
file_paths = [os.path.join(cwd, '..', '..', 'nodejs', file_name) for file_name in file_names]
|
||||
for file_path in file_paths:
|
||||
with open(file_path) as f:
|
||||
content = json.load(f)
|
||||
current_version = content['version']
|
||||
if version != current_version:
|
||||
content['version'] = version
|
||||
with open(file_path, 'w') as f:
|
||||
json.dump(content, f, indent=2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_version()
|
||||
|
|
|
|||
Loading…
Reference in a new issue