From 28816bd98d4411dac250c2eb477315571c51da08 Mon Sep 17 00:00:00 2001 From: raz0red Date: Sat, 4 Jan 2020 14:30:33 -0800 Subject: [PATCH] Updated dist to build in specified directory Avoids any issues from building via mount --- .github/workflows/main.yml | 2 +- dist.sh | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 532d08a..f6d85d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: with: submodules: recursive - run: docker run raz0red/devkitppc /opt/devkitpro/pacman/bin/pacman -Q - - run: docker run -v $(pwd):/source raz0red/devkitppc /source/dist.sh + - run: docker run -v $(pwd):/source raz0red/devkitppc /source/dist.sh /tmp/wii7800 - uses: actions/upload-artifact@v1 with: name: dist diff --git a/dist.sh b/dist.sh index facf34d..b6c4dae 100755 --- a/dist.sh +++ b/dist.sh @@ -22,6 +22,29 @@ function fail() { exit 1 } +# +# Build in directory specified (if applicable) +# +if [ ! -z $1 ]; then + BUILD_DIR=$1 + echo "Building in: $BUILD_DIR..." + rm -rf $BUILD_DIR \ + || { fail 'Unable to delete build directory.'; } + cp -R $SCRIPTPATH $BUILD_DIR \ + || { fail 'Unable to copy files to build directory.'; } + find $BUILD_DIR -type f \ + \( -name "*.o" -or -name "*.a" -or -name "*.dol" -or -name "*.elf" \) \ + -exec rm {} + \ + || { fail 'Unable to delete previous build output files.'; } + $BUILD_DIR/dist.sh \ + || { fail 'Error running dist script.'; } + rm -rf $DIST_DIR \ + || { fail 'Unable to remove dist directory.'; } + cp -R $BUILD_DIR/dist $DIST_DIR \ + || { fail 'Unable to copy files to final dist directory.'; } + exit 0 +fi + # Build wii-emucommon echo "Building wii-emucommon..." $EMUCOMMON_DIR/dist.sh || { fail 'Error building wii-emucommon.'; }