summaryrefslogtreecommitdiff
path: root/scripts/update-web.sh
diff options
context:
space:
mode:
authorBrad Pitcher <bradpitcher@gmail.com>2011-10-16 07:39:17 (GMT)
committerBrad Pitcher <bradpitcher@gmail.com>2011-10-16 07:39:17 (GMT)
commit6acf0b5019d8b68d81f6c1facd6f889c1f468b53 (patch)
tree3a2e63047e6a281178aa7ee0169db5fa7c3ba2e8 /scripts/update-web.sh
parent45060878b56070fa12e6f0bb85bad1f6e1687b71 (diff)
support mingw win32 builds
Diffstat (limited to 'scripts/update-web.sh')
-rwxr-xr-xscripts/update-web.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/update-web.sh b/scripts/update-web.sh
index 4180d01..9036d9b 100755
--- a/scripts/update-web.sh
+++ b/scripts/update-web.sh
@@ -1,13 +1,27 @@
#!/bin/bash
-dmgfile=$1
-if [ -z "$dmgfile" ]; then
- echo "Usage: $0 <dmgfile>"
+# Works with Mac OS X and Linux cross-compiling for windows using
+# mingw-cross-env (use like: OS=LINXWIN update-web.sh file1.zip file2.exe).
+
+file1=$1
+if [ -z "$file1" ]; then
+ echo "Usage: $0 <file1> [<file2>]"
exit 1
fi
+
+if [[ $OSTYPE =~ "darwin" ]]; then
+ OS=MACOSX
+fi
+
indexfile=../openscad.github.com/index.html
if [ -f $indexfile ]; then
- sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$dmgfile\\3$dmgfile\\5/" $indexfile
+ if [ $OS == MACOSX ]; then
+ sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
+ elif [ $OS == LINXWIN ]; then
+ file2=$2
+ sed -i .backup -e "s/^\(.*win-snapshot-zip.*\)\(OpenSCAD-.*\.zip\)\(.*\)\(OpenSCAD-.*zip\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile
+ sed -i .backup -e "s/^\(.*win-snapshot-exe.*\)\(OpenSCAD-.*-Installer\.exe\)\(.*\)\(OpenSCAD-.*-Installer.exe\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile
+ fi
echo "Web page updated. Remember to commit and push openscad.github.com"
else
echo "Web page not found at $indexfile"
contact: Jan Huwald // Impressum