33 lines
611 B
Python
Executable File
33 lines
611 B
Python
Executable File
#!/usr/bin/python
|
|
import os
|
|
import sys
|
|
import json
|
|
|
|
apps = ['core', 'api', 'www']
|
|
commands = {
|
|
'build': 'npm run build',
|
|
'install': 'npm ci',
|
|
'prettier': 'npm run prettier'
|
|
}
|
|
|
|
|
|
def print_commands():
|
|
print('Commandes disponibles: ', [c for c in commands])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) < 2:
|
|
print_commands()
|
|
exit()
|
|
|
|
cmd = sys.argv[1]
|
|
if cmd not in commands:
|
|
print('Commande \'%s\' non disponible' % cmd)
|
|
print_commands()
|
|
exit()
|
|
|
|
for app in apps:
|
|
os.chdir(app)
|
|
os.system(commands[cmd])
|
|
os.chdir('..')
|