mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-15 15:01:13 +00:00
potential fixes for windows
hopefully fixes scss and email generation on windows by fixing runcmd() and (optionally) reading npm bin location from the 'npm bin' command. also, config path is cast to string before being passed to configparser.
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
import subprocess
|
||||
import shutil
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
def runcmd(cmd):
|
||||
if os.name == "nt":
|
||||
return subprocess.check_output(cmd, shell=True)
|
||||
proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
|
||||
return proc.communicate()
|
||||
|
||||
local_path = Path(__file__).resolve().parent
|
||||
node_bin = local_path.parent / 'node_modules' / '.bin'
|
||||
node_bin = Path(runcmd("npm bin")[0].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'
|
||||
print(f"this? \"{node_bin}\"")
|
||||
if input("[yY/nN]: ").lower() == "n":
|
||||
node_bin = input("input bin directory: ")
|
||||
|
||||
for mjml in [f for f in local_path.iterdir() if f.is_file() and 'mjml' in f.suffix]:
|
||||
print(f'Compiling {mjml.name}')
|
||||
|
||||
Reference in New Issue
Block a user