forked from suavecode/SUAVE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
folder_setup.py
90 lines (62 loc) · 2.1 KB
/
folder_setup.py
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# folder_setup.py
# Created: Trent L. June 2015
# Modified:
'''
# About
This script creates a set of folders and clones SUAVE repo's.
# How to use this script
Open a command line terminal, and change directories to
the folder in which you want to start a new SUAVE Project.
Windows users, download msysgit (msysgit.github.io) and
type "git bash" in the start menu to get a command line.
This is the command:
$ python folder_setup.py
If you would like to use an ssh key to clone, use this command:
$ python folder_setup.py ssh
Windows users, setup a puttykey file to use this feature.
If you have access to the additional developer repo's:
$ python folder_setup.py ssh all
'''
# ----------------------------------------------------------------------
# Import
# ----------------------------------------------------------------------
import sys, os, shutil
# ----------------------------------------------------------------------
# Setup
# ----------------------------------------------------------------------
urls = {
'source' : 'suavecode/SUAVE.git',
'tutorials' : 'suavecode/Tutorials.git',
'experimental' : 'suavecode/Experimental.git',
'website' : 'suavecode/suavecode.github.io.git',
}
argv = sys.argv
ssh = 'ssh' in argv
dev = 'all' in argv
def git_clone(url):
if ssh:
os.system('git clone git@github.com:' + url)
else:
os.system('git clone https://github.com/' + url)
return
# ----------------------------------------------------------------------
# Clone
# ----------------------------------------------------------------------
# Project
os.mkdir('SUAVE_Project')
os.chdir('SUAVE_Project')
# Source
git_clone(urls['source'])
os.rename('SUAVE','Source')
# Tutorials
git_clone(urls['tutorials'])
# Workspace
os.mkdir('Workspace')
if dev:
# Experimental
git_clone(urls['experimental'])
# Website
git_clone(urls['website'])
os.rename('suavecode.github.io','Website')
# move this file
shutil.move('../folder_setup.py','.')