version 1.2, 2024/04/13 13:04:07
|
version 1.4, 2024/05/15 01:42:19
|
Line 1
|
Line 1
|
#!/bin/bash |
#!/bin/bash |
|
|
|
# go home |
|
PWD="$(pwd)" |
|
cd "$(dirname "${BASH_SOURCE[0]}")" |
|
if [ $? -ne 0 ]; then echo "Can't go home." && exit 1; fi |
|
|
|
# set DMG name |
sshfs_mountlet_dmg="sshfs-mountlet_v$(grep -m 1 "VERSION=" SSHFS-Mountlet/src/sshfs-mountlet | sed -e "s/^.*VERSION=\"//" -e "s/\"$//").dmg" |
sshfs_mountlet_dmg="sshfs-mountlet_v$(grep -m 1 "VERSION=" SSHFS-Mountlet/src/sshfs-mountlet | sed -e "s/^.*VERSION=\"//" -e "s/\"$//").dmg" |
|
|
|
# create dist directory |
|
if [ ! -e dist ]; then |
|
mkdir dists |
|
fi |
|
|
|
# remove existing DMG of same version |
if [ -e "dist/$sshfs_mountlet_dmg" ]; then |
if [ -e "dist/$sshfs_mountlet_dmg" ]; then |
rm "dist/$sshfs_mountlet_dmg" |
rm "dist/$sshfs_mountlet_dmg" |
fi |
fi |
|
|
|
# delete CVS dirs |
|
if [ ! -e .orig ]; then |
|
find SSHFS-Mountlet -type d -name CVS -exec rm -fr {} \; |
|
find SSHFS-Mountlet -type f -name .DS_Store -delete |
|
fi |
|
|
|
# create DMG |
hdiutil create "dist/$sshfs_mountlet_dmg" -volname SSHFS-Mountlet -fs HFS+ -srcfolder SSHFS-Mountlet |
hdiutil create "dist/$sshfs_mountlet_dmg" -volname SSHFS-Mountlet -fs HFS+ -srcfolder SSHFS-Mountlet |
|
|
rm dist/sha256 ; shasum -a 256 dist/* > dist/sha256 |
# relink |
|
cd dist |
|
rm changelog README license.txt |
|
ln ../SSHFS-Mountlet/changelog |
|
ln ../SSHFS-Mountlet/README |
|
ln ../SSHFS-Mountlet/license.txt |
|
|
|
# calculate sha256 sums |
|
if [ -e "sha256" ]; then |
|
rm sha256 |
|
fi |
|
shasum -a 256 * > sha256 |
|
|
|
cd "$PWD" |