mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Use current Python interpreter to show updated version
This commit is contained in:
@ -35,8 +35,7 @@ def cli():
|
|||||||
fg="yellow")
|
fg="yellow")
|
||||||
|
|
||||||
cmds = (
|
cmds = (
|
||||||
[os.path.normpath(sys.executable),
|
["pip", "install", "--upgrade", "platformio"],
|
||||||
"-m", "pip", "install", "--upgrade", "platformio"],
|
|
||||||
["platformio", "--version"]
|
["platformio", "--version"]
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -44,11 +43,12 @@ def cli():
|
|||||||
r = None
|
r = None
|
||||||
try:
|
try:
|
||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
|
cmd = [os.path.normpath(sys.executable), "-m"] + cmd
|
||||||
r = None
|
r = None
|
||||||
r = util.exec_command(cmd)
|
r = util.exec_command(cmd)
|
||||||
|
|
||||||
# try pip with disabled cache
|
# try pip with disabled cache
|
||||||
if r['returncode'] != 0 and cmd[0] != "platformio":
|
if r['returncode'] != 0 and cmd[2] == "pip":
|
||||||
cmd.insert(3, "--no-cache-dir")
|
cmd.insert(3, "--no-cache-dir")
|
||||||
r = util.exec_command(cmd)
|
r = util.exec_command(cmd)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user