From eeaefee12d6d80124aa26240ba5990bd71776b86 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:22:55 -0400 Subject: [PATCH] Updated / genericized remote_build.sh. --- remote_build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/remote_build.sh b/remote_build.sh index 1d603ddc89..a6c8d51f01 100644 --- a/remote_build.sh +++ b/remote_build.sh @@ -1,5 +1,6 @@ #!/bin/bash +# Git REmote Make # Push to SSH machine; build and scp build products back set -e @@ -7,9 +8,10 @@ git_branch=$(git branch --show-current) # 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 +make_cmd=$(git config --local remake.make) +make_product=$(git config --local remake.src) +make_dest=$(git config --local remake.dest) 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 && \ - echo \"Using \`nproc\` job(s)\" && make DDEBUG=1 -j\`nproc\`" -scp "$remote_host:$remote_path/pokeemerald.gba" romhack.gba +ssh $remote_host "cd $remote_path && git reset --hard && git checkout $git_branch && $make_cmd" +scp "$remote_host:$remote_path/$make_product" $make_dest