2021-03-01 01:40:43 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-03-24 22:17:27 +00:00
|
|
|
# Push to SSH machine; build and scp build products back
|
2021-03-01 01:40:43 +00:00
|
|
|
|
|
|
|
set -e
|
2021-03-01 08:59:13 +00:00
|
|
|
git_branch=$(git branch --show-current)
|
2021-03-24 22:17:27 +00:00
|
|
|
# See https://unix.stackexchange.com/a/13472
|
|
|
|
remote_host=$(git remote get-url build | sed -nr -e "s/ssh:\/\/(\w+@?\w*):.*/\1/p") # Extract remote host
|
|
|
|
remote_path=$(git remote get-url build | sed -nr -e "s/ssh:\/\/\w+@?\w*://p") # Extract remote path
|
|
|
|
set -x
|
|
|
|
git push build --force
|
|
|
|
# `nproc` must be escaped so that it executes on the remote machine
|
|
|
|
ssh $remote_host "cd $remote_path && git reset --hard && git checkout $git_branch && \
|
2021-06-15 23:05:38 +01:00
|
|
|
echo \"Using \`nproc\` job(s)\" && make DDEBUG=1 -j\`nproc\`"
|
2021-03-24 22:17:27 +00:00
|
|
|
scp "$remote_host:$remote_path/pokeemerald.gba" romhack.gba
|