a2d/desk.acc/res/package.sh

39 lines
1009 B
Bash
Raw Normal View History

2018-04-21 05:56:35 +00:00
#!/bin/bash
# Use Cadius to create a disk image for distribution
# https://github.com/mach-kernel/cadius
set -e
CADIUS="${CADIUS:-$HOME/dev/cadius/bin/release/cadius}"
DAS=$(cat TARGETS)
2018-04-21 05:56:35 +00:00
PACKDIR="out/package"
FINFO="$PACKDIR/_FileInformation.txt"
IMGFILE="out/DeskAccessories.po"
2018-04-21 05:56:35 +00:00
VOLNAME="DESK.ACC"
mkdir -p "$PACKDIR"
echo "" > "$FINFO"
# Prepare _FileInformation.txt file with extra ProDOS file entry data
# and copy renamed files into package directory.
for file in $DAS; do
ucfile=$(echo $file | tr a-z A-Z)
echo "$ucfile=Type(F1),AuxType(0640),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)" >> "$FINFO"
cp "out/$file.built" "out/package/$ucfile"
2018-04-21 05:56:35 +00:00
done
# Create a new disk image.
$CADIUS CREATEVOLUME $IMGFILE $VOLNAME 143KB
2018-04-21 05:56:35 +00:00
# Add the files into the disk image.
for file in $DAS; do
ucfile=$(echo $file | tr a-z A-Z)
$CADIUS ADDFILE $IMGFILE "/$VOLNAME" $PACKDIR/$ucfile
done