-
Notifications
You must be signed in to change notification settings - Fork 1
/
amake
executable file
·35 lines (27 loc) · 1.24 KB
/
amake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import os
import sys
import subprocess
input_command = sys.argv[1]
input_arguments = sys.argv[2:]
available_commands = [
("run:book", "mdbook serve docs", "Serves the mdbook"),
("run:client", "cd web/allotize-web && yarn start", "Serves the web client"),
("run:essence", "cd web/allotize-essence && yarn start", "Serves the essence project"),
("run:signal", "cd allotize-signal && cargo run", "Starts the signaling server"),
("pack:core", "wasm-pack build allotize-core && cd web/allotize-js && yarn && yarn build", "Generates a new WASM pkg from the Rust source"),
("test", "wasm-pack test --firefox --headless", "Runs the tests"),
("fmt", "cargo fmt", "Formats the code"),
("fix", "cargo fix", "Fixes problems in the code"),
("doc", "cargo doc --document-private-items", "Builds the internal documentation"),
]
for cmd in available_commands:
if input_command == cmd[0]:
os.system(cmd[1] + " " + ' '.join(input_arguments))
sys.exit(0)
print("\nCommand is not suported, available commands include: ")
align = (max(len(cmd[0]) for cmd in available_commands))
for cmd in available_commands:
command, _, description = cmd;
print(" " + command + (align-len(command))*" " + " - " + description)
sys.exit(1)