Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add export package list functionality #1361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
"caption": "Package Control: Satisfy Dependencies",
"command": "satisfy_dependencies"
},
{
"caption": "Package Control: Export Package List",
"command": "export_package_list"
},
{
"caption": "Preferences: Package Control Settings – Default",
"command": "open_file", "args":
Expand Down
2 changes: 2 additions & 0 deletions package_control/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .disable_package_command import DisablePackageCommand
from .discover_packages_command import DiscoverPackagesCommand
from .enable_package_command import EnablePackageCommand
from .export_package_list_command import ExportPackageListCommand
from .install_local_dependency_command import InstallLocalDependencyCommand
from .install_package_command import InstallPackageCommand
from .list_packages_command import ListPackagesCommand
Expand All @@ -27,6 +28,7 @@
'DisablePackageCommand',
'DiscoverPackagesCommand',
'EnablePackageCommand',
'ExportPackageListCommand',
'InstallLocalDependencyCommand',
'InstallPackageCommand',
'ListPackagesCommand',
Expand Down
18 changes: 18 additions & 0 deletions package_control/commands/export_package_list_command.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sublime
import sublime_plugin

from ..package_manager import PackageManager


class ExportPackageListCommand(sublime_plugin.WindowCommand):
def run(self):
manager = PackageManager()
packages = manager.list_packages()
packages.remove("Package Control")

view = self.window.new_file()
view.run_command("insert_snippet", {
"contents": "# Use Package Control: Advanced Install Package and paste the list\n\n%s"
% ",".join(packages)
})