Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

only write to elm-package.json if needed #13

Merged
merged 1 commit into from
Oct 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions native_package_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ def update_elm_package(vendor_dir, configs, packages):
source_directories = data['source-directories']
path = '../' * config.count('/')

needs_save = False

for package in packages:
current_package_dirs = get_source_dirs(vendor_dir, package)

Expand All @@ -199,9 +201,11 @@ def update_elm_package(vendor_dir, configs, packages):

if relative_path not in data['source-directories']:
data['source-directories'].append(relative_path)
needs_save = True

with open(config, 'w') as f:
f.write(json.dumps(data, indent=4))
if needs_save:
with open(config, 'w') as f:
f.write(json.dumps(data, indent=4))

return repository

Expand Down