better patch base
This commit is contained in:
parent
4089db70f9
commit
b7d6119058
|
@ -1 +1,3 @@
|
|||
.idea
|
||||
scratch-blocks
|
||||
scratch-gui
|
||||
|
|
46
pbt.sh
46
pbt.sh
|
@ -6,37 +6,51 @@ job_start() {
|
|||
# [*] job start - [target]:[job]
|
||||
# bold
|
||||
echo -e "\e[1m[*] job start - $1:$2\e[0m"
|
||||
job_start=$(date +%s)
|
||||
job_start=$(date +%s.%N)
|
||||
}
|
||||
job_success() {
|
||||
# [*] success! [target]:[job] finished in 241.2s :)
|
||||
end=$(date +%s)
|
||||
time=$(( end - job_start ))
|
||||
end=$(date +%s.%N)
|
||||
time=$( echo "$end - $job_start" | bc -l )
|
||||
echo -e "\e[1m\e[32m[*] success! $1:$2 finished in $time seconds :)\e[0m"
|
||||
}
|
||||
job_fail() {
|
||||
# [x] FAIL! [target]:[job] failed in 241.2s :(
|
||||
end=$(date +%s)
|
||||
time=$(( end - job_start ))
|
||||
end=$(date +%s.%N)
|
||||
time=$( echo "$end - $job_start" | bc -l )
|
||||
echo -e "\e[1m\e[31m[*] FAIL! $1:$2 failed in $time seconds :(\e[0m"
|
||||
}
|
||||
job_skip() {
|
||||
# [-] skipped - [target]:[job] skipped in 241.2s
|
||||
end=$(date +%s.%N)
|
||||
time=$( echo "$end - $job_start" | bc -l )
|
||||
echo -e "\e[1m\e[34m[-] skipped - $1:$2 skipped after $time seconds\e[0m"
|
||||
}
|
||||
|
||||
sub_clone() {
|
||||
job_start "scratch-blocks" "clone"
|
||||
|
||||
git submodule init
|
||||
if [ -d "$(pwd)/scratch-blocks" ]; then
|
||||
echo "Clone dir already exists"
|
||||
job_skip "scratch-blocks" "clone"
|
||||
else
|
||||
git clone https://github.com/scratchfoundation/scratch-blocks scratch-blocks
|
||||
if [ "$?" != "0" ]; then
|
||||
job_fail "scratch-blocks" "clone"
|
||||
exit 1
|
||||
fi
|
||||
job_success "scratch-blocks" "clone"
|
||||
fi
|
||||
job_start "scratch-blocks" "checkout"
|
||||
pbase=$(<patches/scratch-blocks/PATCH-BASE)
|
||||
echo "Checking out scratch-blocks patchbase $pbase"
|
||||
cd scratch-blocks || exit
|
||||
git checkout "$pbase"
|
||||
if [ "$?" != "0" ]; then
|
||||
job_fail "scratch-blocks" "clone"
|
||||
job_fail "scratch-blocks" "checkout"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git submodule update
|
||||
if [ "$?" != "0" ]; then
|
||||
job_fail "scratch-blocks" "clone"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
job_success "scratch-blocks" "clone"
|
||||
cd .. || exit
|
||||
job_success "scratch-blocks" "checkout"
|
||||
}
|
||||
|
||||
sub_patch() {
|
||||
|
|
Loading…
Reference in New Issue