Completed
Push — master ( 618bcd...4a6efe )
by Bart
01:11
created

bin.main()   A

Complexity

Conditions 4

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 4
dl 0
loc 21
rs 9.0534
1
#!/usr/bin/env python3
2
3
import os
4
import subprocess
5
6
from nsmaps.local_settings import DEPLOY_DIR
7
8
9
def main():
10
    if not os.path.exists(DEPLOY_DIR):
11
        print('ERROR: Deploy dir ' + DEPLOY_DIR + ' does not exists. Please set it in local_settings.py')
12
13
    print('Deploying to: ' + DEPLOY_DIR)
14
15
    filepaths = {
16
        'website/index.html',
17
        'website/station_map.js'
18
    }
19
20
    filepaths_css = {
21
        'website/css/nsmaps.css',
22
        'website/css/bootstrap_readable.min.css'
23
    }
24
25
    for file in filepaths:
26
        subprocess.check_call(['scp', file, DEPLOY_DIR])
27
28
    for file in filepaths_css:
29
        subprocess.check_call(['scp', file, os.path.join(DEPLOY_DIR, 'css')])
30
31
32
if __name__ == "__main__":
33
    main()