Skip to content

Commit

Permalink
Allow dependencies to be installed inside a .sublime-package
Browse files Browse the repository at this point in the history
My dependency can be packed inside a `.sublime-package`, there no
need to it be on the loose user packages folder. When I need it, I
just import like:
```python
from DependencyName.file_name import CoolClass
```
  • Loading branch information
evandrocoan committed Oct 23, 2017
1 parent 03f0233 commit f6f6d92
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packagesmanager/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,9 +1185,11 @@ def install_package(self, package_name, is_dependency=False):

dependencies_path = 'dependencies.json'
no_package_file_zip_path = '.no-sublime-package'
on_package_file_zip_path = '.on-sublime-package'
if skip_root_dir:
dependencies_path = root_level_paths[0] + dependencies_path
no_package_file_zip_path = root_level_paths[0] + no_package_file_zip_path
on_package_file_zip_path = root_level_paths[0] + on_package_file_zip_path

# If we should extract unpacked or as a .sublime-package file
unpack = True
Expand All @@ -1210,6 +1212,13 @@ def install_package(self, package_name, is_dependency=False):
if is_dependency:
unpack = True

# If it is a dependency and package maintainer doesn't want a .sublime-package
try:
package_zip.getinfo(on_package_file_zip_path)
unpack = False
except (KeyError):
pass

# If dependencies were not in the channel, try the package
if not is_dependency and not have_installed_dependencies:
try:
Expand Down

0 comments on commit f6f6d92

Please sign in to comment.