File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 11from __future__ import print_function
22
3+ import sys
4+ import os
5+ import pipes
6+ import shutil
7+ import subprocess
8+
39from setuptools import setup , find_packages
10+ from distutils import log
411from distutils .command .build import build # type: ignore
512from distutils .command .sdist import sdist # type: ignore
613from setuptools .command .develop import develop
7- import os
8- import subprocess
14+
15+ if sys .platform == "win32" :
16+ from subprocess import list2cmdline
17+ else :
18+
19+ def list2cmdline (cmd_list ):
20+ return " " .join (map (pipes .quote , cmd_list ))
21+
922
1023# the name of the project
1124name = "idom"
109122def build_javascript_first (cls ):
110123 class Command (cls ):
111124 def run (self ):
112- for cmd_str in ["npm install" , "npm run build" ]:
113- subprocess . check_call (
114- cmd_str . split (), cwd = os . path . join ( root , "client" , "app" )
115- )
125+ for cmd , * args in map ( str . split , ["npm install" , "npm run build" ]) :
126+ cmd_args = [ shutil . which ( cmd )] + args
127+ log . info ( list2cmdline ( cmd_args ) )
128+ subprocess . check_call ( cmd_args , cwd = os . path . join ( root , "client" , "app" ) )
116129 super ().run ()
117130
118131 return Command
You can’t perform that action at this time.
0 commit comments