forked from platformio/platformio-core
Support for GitPod environment
This commit is contained in:
@ -255,6 +255,8 @@ def get_cid():
|
|||||||
uid = None
|
uid = None
|
||||||
if os.getenv("C9_UID"):
|
if os.getenv("C9_UID"):
|
||||||
uid = os.getenv("C9_UID")
|
uid = os.getenv("C9_UID")
|
||||||
|
elif os.getenv("GITPOD_GIT_USER_NAME"):
|
||||||
|
uid = os.getenv("GITPOD_GIT_USER_NAME")
|
||||||
elif os.getenv("CHE_API", os.getenv("CHE_API_ENDPOINT")):
|
elif os.getenv("CHE_API", os.getenv("CHE_API_ENDPOINT")):
|
||||||
try:
|
try:
|
||||||
uid = json.loads(
|
uid = json.loads(
|
||||||
|
@ -73,16 +73,19 @@ def on_platformio_exception(e):
|
|||||||
|
|
||||||
def set_caller(caller=None):
|
def set_caller(caller=None):
|
||||||
caller = caller or getenv("PLATFORMIO_CALLER")
|
caller = caller or getenv("PLATFORMIO_CALLER")
|
||||||
if not caller:
|
if caller:
|
||||||
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
|
return app.set_session_var("caller_id", caller)
|
||||||
caller = "vscode"
|
if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
|
||||||
elif is_container():
|
caller = "vscode"
|
||||||
if getenv("C9_UID"):
|
elif getenv("GITPOD_INSTANCE_ID") or getenv("GITPOD_WORKSPACE_URL"):
|
||||||
caller = "C9"
|
caller = "gitpod"
|
||||||
elif getenv("USER") == "cabox":
|
elif is_container():
|
||||||
caller = "CA"
|
if getenv("C9_UID"):
|
||||||
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
|
caller = "C9"
|
||||||
caller = "Che"
|
elif getenv("USER") == "cabox":
|
||||||
|
caller = "CA"
|
||||||
|
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
|
||||||
|
caller = "Che"
|
||||||
app.set_session_var("caller_id", caller)
|
app.set_session_var("caller_id", caller)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user