better patch base
This commit is contained in:
parent
4089db70f9
commit
b7d6119058
|
@ -1 +1,3 @@
|
||||||
.idea
|
.idea
|
||||||
|
scratch-blocks
|
||||||
|
scratch-gui
|
||||||
|
|
46
pbt.sh
46
pbt.sh
|
@ -6,37 +6,51 @@ job_start() {
|
||||||
# [*] job start - [target]:[job]
|
# [*] job start - [target]:[job]
|
||||||
# bold
|
# bold
|
||||||
echo -e "\e[1m[*] job start - $1:$2\e[0m"
|
echo -e "\e[1m[*] job start - $1:$2\e[0m"
|
||||||
job_start=$(date +%s)
|
job_start=$(date +%s.%N)
|
||||||
}
|
}
|
||||||
job_success() {
|
job_success() {
|
||||||
# [*] success! [target]:[job] finished in 241.2s :)
|
# [*] success! [target]:[job] finished in 241.2s :)
|
||||||
end=$(date +%s)
|
end=$(date +%s.%N)
|
||||||
time=$(( end - job_start ))
|
time=$( echo "$end - $job_start" | bc -l )
|
||||||
echo -e "\e[1m\e[32m[*] success! $1:$2 finished in $time seconds :)\e[0m"
|
echo -e "\e[1m\e[32m[*] success! $1:$2 finished in $time seconds :)\e[0m"
|
||||||
}
|
}
|
||||||
job_fail() {
|
job_fail() {
|
||||||
# [x] FAIL! [target]:[job] failed in 241.2s :(
|
# [x] FAIL! [target]:[job] failed in 241.2s :(
|
||||||
end=$(date +%s)
|
end=$(date +%s.%N)
|
||||||
time=$(( end - job_start ))
|
time=$( echo "$end - $job_start" | bc -l )
|
||||||
echo -e "\e[1m\e[31m[*] FAIL! $1:$2 failed in $time seconds :(\e[0m"
|
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() {
|
sub_clone() {
|
||||||
job_start "scratch-blocks" "clone"
|
job_start "scratch-blocks" "clone"
|
||||||
|
if [ -d "$(pwd)/scratch-blocks" ]; then
|
||||||
git submodule init
|
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
|
if [ "$?" != "0" ]; then
|
||||||
job_fail "scratch-blocks" "clone"
|
job_fail "scratch-blocks" "checkout"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cd .. || exit
|
||||||
git submodule update
|
job_success "scratch-blocks" "checkout"
|
||||||
if [ "$?" != "0" ]; then
|
|
||||||
job_fail "scratch-blocks" "clone"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
job_success "scratch-blocks" "clone"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub_patch() {
|
sub_patch() {
|
||||||
|
|
Loading…
Reference in New Issue