npm.py 336 B

123456789101112131415161718
  1. import subprocess
  2. import sys
  3. def npm(*npm_args):
  4. call_args = [__get_executable_name()] + list(npm_args)
  5. subprocess.check_call(call_args)
  6. def __get_executable_name():
  7. executable = 'npm'
  8. if sys.platform == 'win32':
  9. executable += '.cmd'
  10. return executable
  11. if __name__ == '__main__':
  12. npm(*sys.argv[1:])