Skip to content

Commit

Permalink
Remove dialog dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
phracker committed Oct 12, 2014
1 parent 5927ace commit 6dd423b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

# Ignore release directory
release/*
release/
release/

release_backup/*
release_backup/
38 changes: 19 additions & 19 deletions make_tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,35 @@ TARGET="$(pwd)";
LOGFILE="$(mktemp)";

log() {
dialog --infobox "$@" 4 80;
log "$@" 2>&1 | tee "$LOGFILE";
}

echo "Directory: $TARGET";
echo "Log: $LOGFILE";

if [[ -f "$(which dialog)" ]]; then
echo "Dialog installed at $(which dialog).";
else
echo "Dialog not installed. Please install and try again.";
exit;
fi
log "Current Directory: $TARGET";
log "Log: $LOGFILE";

if [[ $# -eq 0 ]]; then
echo "Building MacOSX-SDKs release tarballs.";
log "Building release tarballs.";
else
echo "This script does not take arguments.";
log "This script does not take arguments.";
exit;
fi

if [[ ! -d "$TARGET/release/" ]]; then
echo "Making release directory at $TARGET/release/";
log "Making release directory at $TARGET/release/";
mkdir "$TARGET/release/";
else
dialog --title "Releases Directory" --yesno "An old release directory was found. Would you like to delete it before proceeding?" 10 60;
echo "\$?: $?";
if [[ "$?" -eq "0" ]]; then
echo "Removing old release directory at $TARGET/release/";
echo -n "An old release directory was found. Would you like to delete it before proceeding? [Y/n]: ";
read DELETE_RELEASES;
echo "";
if [[ ! "$DELETE_RELEASES" -eq "n" ]]; then
log "Removing old release directory at $TARGET/release/";
rm -rf "$TARGET/release/";
echo "Making release directory at $TARGET/release/";
log "Making release directory at $TARGET/release/";
mkdir "$TARGET/release/";
else
log "Moving old release directory to $TARGET/release_backup/";
mv "$TARGET/release/" "$TARGET/release_backup/";
log "Making release directory at $TARGET/release/";
mkdir "$TARGET/release/";
fi
fi
Expand All @@ -45,4 +44,5 @@ for sdk_directory in *.sdk; do
tar -cpJf "release/$sdk_directory.tar.xz" "$sdk_directory";
done

du -h "$TARGET/release/"* | sed s/release\\\///g;
log "Done. Contents of $TARGET/release/:";
du -h "$TARGET/release/"* | sed s/release\\\///g 2>&1 | tee "$LOGFILE";

0 comments on commit 6dd423b

Please sign in to comment.