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

Commit

Permalink
Check for package directory not the tar
Browse files Browse the repository at this point in the history
Because sometimes unarchiving the tar can fail.
  • Loading branch information
ento committed Jul 2, 2017
1 parent 3965f45 commit ff997e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions native_package_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,12 @@ def update_source_directories(vendor_dir, elm_package_paths, native_packages):
return repository


def exclude_downloaded_packages(vendor_dir, packages):
return [x for x in packages if not os.path.isfile(format_tar_path(vendor_dir, x))]
def exclude_existing_packages(vendor_dir, packages):
return [x for x in packages if not package_exists(vendor_dir, x)]


def package_exists(vendor_dir, package):
return os.path.isdir(vendor_package_dir(vendor_dir, package))


def main(native_elm_package_path, elm_package_paths, vendor_dir):
Expand All @@ -230,7 +234,7 @@ def main(native_elm_package_path, elm_package_paths, vendor_dir):

raw_json = read_native_elm_package(native_elm_package_path)
all_packages = packages_from_exact_deps(raw_json)
required_packages = exclude_downloaded_packages(absolute_vendor_dir, all_packages)
required_packages = exclude_existing_packages(absolute_vendor_dir, all_packages)
fetch_packages(absolute_vendor_dir, required_packages)
repository = update_source_directories(
absolute_vendor_dir, absolute_elm_package_paths, required_packages)
Expand Down

0 comments on commit ff997e3

Please sign in to comment.