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
1 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,13 @@ def runcmd(cmd):
return proc.communicate()
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?")
if input("[yY/nN]: ").lower() == "n":
node_bin = local_path.parent / 'node_modules' / '.bin'