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

Commit

Permalink
add example for deps syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
eeue56 committed Mar 10, 2016
1 parent 1eee387 commit e5ff0da
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,23 @@ Majors available for elm-lang/core: [3.0.0]
Majors available for evancz/elm-html: [4.0.2, 4.0.1, 4.0.0]
```

## elm_deps_sync

Sometimes we want to sync the deps between two files, such that all the deps in one file are matched in another file

Usage:

- `--dry` will only print the changes to happen, not write them to file
- `--quiet` will only print the final statement

```bash
python elm_deps_sync.py elm-package.json spec/elm/elm-package.json
```

will print

```
1 packages changed.
Package mgold/elm-date-format inserted to spec/elm/elm-package.json for the first time at version "1.1.2 <= v < 2.0.0"
```
2 changes: 1 addition & 1 deletion elm_deps_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def sync_versions(top_level_file, spec_file, quiet=False, dry=False):
)

if len(messages) > 0:
print('{number} files changed.'.format(number=len(messages)))
print('{number} packages changed.'.format(number=len(messages)))

if not dry:
with open(spec_file, 'w') as f:
Expand Down

0 comments on commit e5ff0da

Please sign in to comment.