-
Notifications
You must be signed in to change notification settings - Fork 3
/
morea-vanilla-install.bat
51 lines (40 loc) · 1.24 KB
/
morea-vanilla-install.bat
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
@echo off
set argC=0
for %%x in (%*) do Set /A argC+=1
IF "%argC%" NEQ "2" GOTO No-args
if exist "%cd%\master\" GOTO master
if exist "%cd%\gh-pages\" GOTO gh-pages
echo "Creating master/ directory with repo."
git clone [email protected]:"%1"/"%2".git master
echo "Creating orphan branch, empty gh-pages/ directory."
git clone [email protected]:"%1"/"%2".git gh-pages
if NOT exist "%cd%\gh-pages" GOTO gh-pages-fail
cd gh-pages
git checkout --orphan gh-pages
git rm -rf .
git branch -u origin/gh-pages
git branch --set-upstream-to=origin/gh-pages gh-pages
cd ..
echo "master/ and gh-pages/ directories created."
echo "Adding a remote called 'core' connected to morea-framework/core (this can fail if already set)"
cd master
git remote add core https://github.com/morea-framework/core.git
echo "Here are the current upstream repos:"
git remote -v
echo "Fetching core"
git fetch core
echo "Merging core into master"
git merge -m "merging core into master" core/master
GOTO end
:No-args
echo "morea-vanilla-install <github account> <github repo>"
GOTO end
:master
echo "master/ directory already exists. Exiting..."
GOTO end
:gh-pages-fail
echo "gh-pages directory not created. Exiting..."
GOTO end
:gh-pages
echo "gh-pages/ directory already exists. Exiting..."
:end