-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsnatic.py
More file actions
54 lines (39 loc) · 926 Bytes
/
snatic.py
File metadata and controls
54 lines (39 loc) · 926 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import click
from setup.executor import Executor
from setup.requirement_exception import RequirementException
from builder.builder import Builder
from uploader.sftp_uploader import SFTPUploader
@click.group()
def cli():
pass
@click.command()
def check():
print("Checking requisites...")
try:
Executor.requisites_check()
except RequirementException as re:
print(str(re))
@click.command()
def serve():
Executor.run_command(['php', '-S', 'localhost:8000', '-t', 'site/'])
@click.command()
def build():
b = Builder()
b.build()
@click.command()
def upload():
u = SFTPUploader()
u.upload()
@click.command()
def deploy():
b = Builder()
b.build()
u = SFTPUploader()
u.upload()
if __name__ == '__main__':
cli.add_command(check)
cli.add_command(serve)
cli.add_command(build)
cli.add_command(upload)
cli.add_command(deploy)
cli()