-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change manifest path into master branch's file
- Loading branch information
1 parent
ff3fb6f
commit c7226ed
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import json | ||
import collections | ||
import sys | ||
|
||
def move_data(prev_path, current_path): | ||
with open(prev_path) as f: | ||
prev_data = json.load(f) | ||
with open(current_path) as f: | ||
current_data = json.load(f, object_pairs_hook=collections.OrderedDict) | ||
|
||
for key, value in current_data.items(): | ||
if key in prev_data: | ||
current_data[key] = prev_data[key] | ||
print(current_data[key]) | ||
else: | ||
print(key) | ||
|
||
with open(current_path, "w") as f: | ||
json.dump(current_data, f, ensure_ascii=False, indent=2) | ||
|
||
move_data(sys.argv[1], sys.argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters