Skip to content
This repository was archived by the owner on Jun 15, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ryppi.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def my_nts(s, encoding, errors):
return
return s.decode(encoding, errors)

modules_dir = r'.\node_modules'
modules_dir = 'node_modules'
tmp_dir = os.path.join(modules_dir, '.tmp')

def cleanupDir(cleanPath):
Expand Down Expand Up @@ -118,7 +118,7 @@ def saveAndExtractPackage(metaData):

def installDependencies(pkgDir, dependencies='dependencies'):
# Recursive install dependencies
print('Checking %s for %s ...' % (dependencies, pkgDir.split('\\')[-1]))
print('Checking %s for %s ...' % (dependencies, os.path.basename(pkgDir)))
metaData = json.loads(open(os.path.join(pkgDir, 'package.json'), 'r').read())
for dep in metaData.get(dependencies, []):
install(dep)
Expand All @@ -137,7 +137,7 @@ def get_installed():
return meta

def install(pkg):
# Installs pkg(s) into .\node_modules
# Installs pkg(s) into node_modules
meta = getMetaDataForPkg(pkg)
destPath = saveAndExtractPackage(meta)
installDependencies(destPath)
Expand All @@ -158,7 +158,7 @@ def update():
install(pkg['name'])

def usage():
print ("""
print("""
Usage:
python ryppi.py deps - Install dependencies from package.json file.
python ryppi.py devDeps - Install development dependencies from package.json file.
Expand Down