Skip to content

Instantly share code, notes, and snippets.

@qwertycody
Created June 3, 2020 13:17
Show Gist options
  • Save qwertycody/f72b1a3c4711abeb7fcd5d1bcd04a39e to your computer and use it in GitHub Desktop.
Save qwertycody/f72b1a3c4711abeb7fcd5d1bcd04a39e to your computer and use it in GitHub Desktop.
Small wrapper script meant for one line execution of the switchroot build by PabloZaiden. Supports foreground/background execution so you can log off and go get a coffee while waiting for the build to complete.
#!/bin/bash
#Ensure nothing happens outside the directory this script is ran from
cd "$(dirname "$0")"
SCRIPT_DIRECTORY=$(pwd)
#Log File Variable
SCREEN_LOG="build.log"
SCREEN_NAME="switchroot_build"
#Remove Old Screen Log
rm -f $SCREEN_LOG
#Begin PabloZaiden Stuff
mkdir -p ./android/lineage
export ROM_NAME=icosa
export ROM_TYPE=zip
#export FLAGS=noupdate
COMMAND_TO_RUN="./build-in-docker.sh "
function doBackground()
{
screen -L $SCREEN_LOG -DmS $SCREEN_NAME $COMMAND_TO_RUN &
#Resume Log Tail process
#screen -R $SCREEN_NAME
tail -n+1 -F $SCREEN_LOG
}
function doForeground()
{
$COMMAND_TO_RUN
}
doBackground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment