Skip to content

Commit

Permalink
Add support to configure install/upgrade messages
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed May 17, 2024
1 parent 974b776 commit e736945
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Package Control.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
// to the Sublime Text console
"debug": false,

// Print package install and upgrade messages.
// Valid values are:
// - "disabled": don't print anything
// - "background": open message view in background
// - "foreground": open message view in foreground
// - "auto": focus messages depending on command mode (unattended)
"print_messages": "auto",

// If package install, upgrade and removal info should be submitted to
// the channel for aggregated statistics
"submit_usage": true,
Expand Down
8 changes: 8 additions & 0 deletions package_control/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(self):
'package_destination',
'package_name_map',
'package_profiles',
'print_messages',
'proxy_password',
'proxy_username',
'remove_orphaned',
Expand Down Expand Up @@ -2141,6 +2142,13 @@ def print_messages(self, package_name, package_dir, is_upgrade, old_version, new
If ``True`` don't focus "Package Control Messages".
"""

if self.settings["print_messages"] == "disabled":
return
elif self.settings["print_messages"] == "background":
unattended = True
elif self.settings["print_messages"] == "foreground":
unattended = False

try:
messages_file = os.path.join(package_dir, 'messages.json')
with open(messages_file, 'r', encoding='utf-8') as fobj:
Expand Down

0 comments on commit e736945

Please sign in to comment.