forked from platformio/platformio-core
Use current interpreter to upgrade PlatformIO
This commit is contained in:
@@ -12,6 +12,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@@ -32,7 +35,8 @@ def cli():
|
|||||||
fg="yellow")
|
fg="yellow")
|
||||||
|
|
||||||
cmds = (
|
cmds = (
|
||||||
["pip", "install", "--upgrade", "platformio"],
|
[os.path.normpath(sys.executable),
|
||||||
|
"-m", "pip", "install", "--upgrade", "platformio"],
|
||||||
["platformio", "--version"]
|
["platformio", "--version"]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -44,8 +48,9 @@ def cli():
|
|||||||
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] == "pip":
|
if r['returncode'] != 0 and cmd[0] != "platformio":
|
||||||
r = util.exec_command(["pip", "--no-cache-dir"] + cmd[1:])
|
cmd.insert(3, "--no-cache-dir")
|
||||||
|
r = util.exec_command(cmd)
|
||||||
|
|
||||||
assert r['returncode'] == 0
|
assert r['returncode'] == 0
|
||||||
assert last in r['out'].strip()
|
assert last in r['out'].strip()
|
||||||
|
Reference in New Issue
Block a user