aseprite/scripts/update_version.sh
David Capello c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00

34 lines
1.0 KiB
Bash

#! /bin/sh
if [ ! -f update_version.sh ]; then
echo You must run update_version.sh from scripts/ directory
exit 1
fi
version=$1
if [ "$version" == "" ]; then
echo Usage: update_version.sh VERSION
exit 1
fi
version_win32=$(echo $1 | sed -e 's/\./,/g' | sed -e 's/-.*$//')
commas=$(grep -o "," <<< "$version_win32" | wc -l)
while [ $commas -lt 3 ] ; do
version_win32+=",0"
commas=$(grep -o "," <<< "$version_win32" | wc -l)
done
sed -e "s/define VERSION.*/define VERSION \"$version\"/" < ../config.h > tmp
mv tmp ../config.h
sed -e "s/gui version=\".*/gui version=\"$version\">/" < ../data/gui.xml > tmp
mv tmp ../data/gui.xml
sed -e "s/FILEVERSION .*/FILEVERSION $version_win32/" < ../src/main/resources_win32.rc \
| sed -e "s/PRODUCTVERSION .*/PRODUCTVERSION $version_win32/" \
| sed -e "s/FileVersion\",.*/FileVersion\", \"$version_win32\"/" \
| sed -e "s/ProductVersion\",.*/ProductVersion\", \"$version_win32\"/" \
> tmp
mv tmp ../src/main/resources_win32.rc