Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cyberswat/4423128d8bd82368610be6dc10a8fa12 to your computer and use it in GitHub Desktop.
Save cyberswat/4423128d8bd82368610be6dc10a8fa12 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
function package {
dir=${PWD##*/}
for filename in "`pwd`/*"
do
echo $filename
if [ "$dir" == "windows" ]
then
zip ddev_"$dir".zip `basename $filename`
shasum -a 256 ddev_"$dir".zip > ddev_"$dir".sha256
else
tar -cvzf ddev_"$dir".tar.gz `basename $filename`
shasum -a 256 ddev_"$dir".tar.gz > ddev_"$dir".sha256
fi
done;
}
function setup {
echo $1
mkdir -p $1/release/darwin
cd $1/release/darwin
curl -O "$2/darwin/ddev"
chmod +x ddev
mkdir -p $1/release/linux
cd $1/release/linux
curl -O "$2/linux/ddev"
chmod +x ddev
mkdir -p $1/release/windows
cd $1/release/windows
curl -O "$2/windows/ddev.exe"
}
DIR=`pwd`
setup $DIR $1
for d in $DIR/release/*/ ; do (cd "$d" && package); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment