mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Improve handling of sys.args
This commit is contained in:
@ -28,7 +28,9 @@ def on_platformio_start(ctx, force):
|
||||
telemetry.on_command(ctx)
|
||||
|
||||
# skip any check operations when upgrade process
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "upgrade":
|
||||
args = [str(s).lower() for s in sys.argv[1:]
|
||||
if not str(s).startswith("-")]
|
||||
if len(args) > 1 and args[1] == "upgrade":
|
||||
return
|
||||
|
||||
after_upgrade(ctx)
|
||||
|
@ -4,9 +4,9 @@
|
||||
import atexit
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
import uuid
|
||||
from sys import argv as sys_argv
|
||||
from time import time
|
||||
|
||||
import click
|
||||
@ -91,7 +91,8 @@ class MeasurementProtocol(TelemetryBase):
|
||||
self['cd4'] = 1 if app.get_setting("enable_prompts") else 0
|
||||
|
||||
def _prefill_screen_name(self):
|
||||
args = [str(s).lower() for s in sys_argv[1:]]
|
||||
args = [str(s).lower() for s in sys.argv[1:]
|
||||
if not str(s).startswith("-")]
|
||||
if not args:
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user