fix email generation on windows

This commit is contained in:
Harvey Tindall 2020-08-04 18:14:39 +01:00
parent 8d265879cc
commit 3d10a8fe06
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -10,7 +10,13 @@ def runcmd(cmd):
return proc.communicate() return proc.communicate()
local_path = Path(__file__).resolve().parent local_path = Path(__file__).resolve().parent
node_bin = Path(runcmd("npm bin")[0].decode('utf-8').rstrip()) out = runcmd("npm bin")
try:
node_bin = Path(out[0].decode('utf-8').rstrip())
except:
node_bin = Path(out.decode('utf-8').rstrip())
print(f"assuming npm bin directory \"{node_bin}\". Is this correct?") print(f"assuming npm bin directory \"{node_bin}\". Is this correct?")
if input("[yY/nN]: ").lower() == "n": if input("[yY/nN]: ").lower() == "n":
node_bin = local_path.parent / 'node_modules' / '.bin' node_bin = local_path.parent / 'node_modules' / '.bin'