Skip to content

Commit

Permalink
generator: Fix generator for json indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyans800755 committed Jun 5, 2017
1 parent f8ed7d0 commit 1d01626
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .ci/generate_bear_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import json
import os
import sys
from collections import OrderedDict

from jinja2 import Environment, FileSystemLoader
from pyprint.NullPrinter import NullPrinter
Expand Down Expand Up @@ -155,9 +156,13 @@ def write_npm_requirements(requirements):

package_json_string = template.render(
dependencies=npm_dependencies, version="0.8.0")
pretty_json = json.dumps(
json.loads(package_json_string, object_pairs_hook=OrderedDict),
indent=2)

with open(os.path.join(PROJECT_DIR, "package.json"), 'w') as file:
file.write(package_json_string)
file.write(pretty_json)
file.write('\n')


def write_pip_requirements(requirements, output):
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"tslint": "~3",
"typescript": ">=1.7.3",
"write-good": "~0.9.1"
}
}
}

0 comments on commit 1d01626

Please sign in to comment.