vscode: support running with -jN

This commit is contained in:
ed 2021-06-08 20:18:24 +02:00
parent 1d6ae409f6
commit 5e159432af

24
.vscode/launch.py vendored
View file

@ -3,14 +3,12 @@
# launches 10x faster than mspython debugpy # launches 10x faster than mspython debugpy
# and is stoppable with ^C # and is stoppable with ^C
import re
import os import os
import sys import sys
import shlex import shlex
sys.path.insert(0, os.getcwd())
import jstyleson import jstyleson
from copyparty.__main__ import main as copyparty import subprocess as sp
with open(".vscode/launch.json", "r", encoding="utf-8") as f: with open(".vscode/launch.json", "r", encoding="utf-8") as f:
tj = f.read() tj = f.read()
@ -25,11 +23,19 @@ except:
pass pass
argv = [os.path.expanduser(x) if x.startswith("~") else x for x in argv] argv = [os.path.expanduser(x) if x.startswith("~") else x for x in argv]
try:
copyparty(["a"] + argv) if re.search(" -j ?[0-9]", " ".join(argv)):
except SystemExit as ex: argv = [sys.executable, "-m", "copyparty"] + argv
if ex.code: sp.check_call(argv)
raise else:
sys.path.insert(0, os.getcwd())
from copyparty.__main__ import main as copyparty
try:
copyparty(["a"] + argv)
except SystemExit as ex:
if ex.code:
raise
print("\n\033[32mokke\033[0m") print("\n\033[32mokke\033[0m")
sys.exit(1) sys.exit(1)