-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate-g8.sh
executable file
·38 lines (29 loc) · 1.12 KB
/
update-g8.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
#!/usr/bin/env bash
if [[ -d ./src/main/g8 ]]; then
if ! command -v git &> /dev/null
then
echo "[ERROR] git command cannot be found, please install git first"
exit -1
fi
if ! command -v sbt &> /dev/null
then
echo "[ERROR] sbt command cannot be found, please install sbt first"
exit -1
fi
mkdir -p target
cd target
if [[ -d .makeitg8 ]] && [[ -d .makeitg8/.git ]] ; then
cd .makeitg8
git pull origin master
else
rm -r .makeitg8
git clone https://github.com/arturopala/make-it-g8.git .makeitg8
cd .makeitg8
fi
sbt "run --noclear --force --source ../../target/sandbox/cross-scala --target ../.. --name cross-scala.g8 --package com.github --description cross-scala.g8 --custom-readme-header-path "../../../description.md" -K templateGithubUser=arturopala libraryName=Hello+World githubUser=Artur+Opala githubEmail=foo%40gmail.com" -Dbuild.test.command="sbt +test"
echo "Done, updated the template based on target/sandbox/cross-scala"
exit 0
else
echo "[ERROR] run the script ./update-g8.sh in the template's root folder"
exit -1
fi