vscode: support running with -jN

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

14
.vscode/launch.py vendored
View file

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