-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·69 lines (47 loc) · 1.77 KB
/
setup.sh
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
#!/bin/sh
# 環境構築---------------------------------------------------------------
# READ_______________________________________________________________
# read new Repository URL
echo " "
echo "========================================================"
echo "please type you new Repository URL and Name"
echo "ex.) https://github.com/(UserName)/(newRepository).git"
echo "ex.) newRepository"
echo "========================================================"
echo " "
echo -n INPUT_URL :
read newRepository
echo " "
echo -n INPUT_NAME:
read newRepositoryName
# END________________________________________________________________
git clone --mirror https://github.com/BIwashi/MySlides.git # --mirrorオプション付きで大本からclone
cd MySlides.git
git push --mirror $newRepository # ここでnewリポジトリに移行
cd ..
sudo rm -rf MySlides.git # バックアップいらないから削除
git clone $newRepository # 新しく作ったリポジトリにからclone
cd $newRepositoryName
git switch gh-pages # ローカルにgh-pagesブランチを作っておく(この操作いらないかも?)
git switch master
git branch # masterに戻しておく
# gh-pagesブランチの./slides以下だけcloneして./slidesディレクトリを作っていれる
git clone $newRepository --branch gh-pages --single-branch ./slides
cd $newRepositoryName
echo " "
echo "_______________Usage_______________"
echo " "
echo " "
echo "【slide作成】"
echo "./make.sh "
echo " "
echo "【ローカルサーバー立ち上げて確認】"
echo "./server.sh"
echo " "
echo "【slideをgh-pagesに反映】"
echo "./gh-pages.sh"
echo " "
echo "【masterのmdをpushする(mdの履歴を残す用)】"
echo "./master.sh"
echo " "
echo "_______________Usage_______________"