Skip to content

Commit

Permalink
removed package build files
Browse files Browse the repository at this point in the history
  • Loading branch information
dbriscoe511 committed Mar 20, 2022
1 parent 08131e7 commit 627159c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions make_a_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ zip -r Board_cleaner-$version-pcm.zip plugins resources metadata.json
rm -r resources
rm -r plugins
rm metadata.json
rm metadata_package.json

# get the sha, size and fill them in the metadata
cp metadata_source.json metadata.json
Expand Down
22 changes: 22 additions & 0 deletions parse_metadata_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
with open('metadata_source.json', 'r') as f:
contents = f.readlines()

# versions start
v_start = 0
v_stop = 0

for i in range(len(contents)):
ln = contents[i]
if "\"version\"" in ln:
v_stop = i
if "\"versions\"" in ln:
v_start = i

# remove from v_start+1 do v_stop-1
index = range(v_start+1, v_stop-1)
new_contents = [element for i, element in enumerate(contents) if i not in index]

with open('metadata.json', 'w') as f:
f.writelines(new_contents)

0 comments on commit 627159c

Please sign in to comment.