Skip to content

Commit

Permalink
Updated security with auto_updater plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckBoss committed Jun 7, 2020
1 parent 458a88f commit faa6f22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion JJMumbleBot/plugins/core/auto_updater/auto_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def process(self, text):
return
res = update_utils.update_available(message_parse[1])
if res is True:
updated_version = update_utils.check_and_update(message_parse[1], self.metadata[C_PLUGIN_SET][P_PIP_CMD])
updated_version = update_utils.check_and_update(message_parse[1], pip_cmd=self.metadata[C_PLUGIN_SET][P_PIP_CMD])
if updated_version:
GS.gui_service.quick_gui(f"Dependency: [{message_parse[1]}] has been updated to v{updated_version}",
text_type='header', box_align='left', ignore_whisper=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from requests import get
from subprocess import call
import pkg_resources
import sys


def check_pypi_version(package_name):
Expand All @@ -14,9 +15,7 @@ def check_pypi_version(package_name):


def update_package(package_name, pip_cmd):
cmd = f'{pip_cmd}'
param = f'install --upgrade {package_name}'
if call([cmd, param]) == 0:
if call([sys.executable, '-m', pip_cmd, 'install', '--upgrade', package_name]) == 0:
return True
return False

Expand Down

0 comments on commit faa6f22

Please sign in to comment.