-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathrun.py
More file actions
31 lines (26 loc) · 797 Bytes
/
run.py
File metadata and controls
31 lines (26 loc) · 797 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
#!/usr/bin/sudo #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import platform
import os
from helpers.cli import CLI
from helpers.command import Command
if sys.version_info[0] == 2:
message = (
'Python 3 is recommended.'
'Kindly install Python 3.+ to install farmstack seamlessly!'
)
CLI.framed_print(message, color=CLI.COLOR_ERROR)
sys.exit(1)
if not platform.system() in ['Linux', 'Darwin']:
CLI.colored_print('Not compatible with this OS', CLI.COLOR_ERROR)
sys.exit(1)
if os.geteuid() != 0:
CLI.framed_print(message='Need Root Permission to install flawlessly. Run:'
'sudo python3 run.py')
sys.exit(1)
if __name__ == '__main__':
try:
Command.compose_datahub()
except Exception as e:
print(e)