Skip to content

Commit 2ffe7cd

Browse files
committed
Fixed a bug with git and hg repositories where the package file would be downloaded even though it was not needed
1 parent c3bb77e commit 2ffe7cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Package Control.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -882,12 +882,6 @@ def install_package(self, package_name):
882882
pristine_package_path = os.path.join(os.path.dirname(
883883
sublime.packages_path()), 'Pristine Packages', package_filename)
884884

885-
package_bytes = self.download_url(url, 'Error downloading package.')
886-
if package_bytes == False:
887-
return False
888-
with open(package_path, "wb") as package_file:
889-
package_file.write(package_bytes)
890-
891885
package_dir = self.get_package_dir(package_name)
892886

893887
if os.path.exists(os.path.join(package_dir, '.git')):
@@ -899,6 +893,12 @@ def install_package(self, package_name):
899893
self.settings['hg_update_command'], package_dir,
900894
self.settings['cache_length']).run()
901895

896+
package_bytes = self.download_url(url, 'Error downloading package.')
897+
if package_bytes == False:
898+
return False
899+
with open(package_path, "wb") as package_file:
900+
package_file.write(package_bytes)
901+
902902
if not os.path.exists(package_dir):
903903
os.mkdir(package_dir)
904904

0 commit comments

Comments
 (0)