Permalink
Browse files

Write app script with LF line endings.

  • Loading branch information...
1 parent d616d60 commit 66315c8da1312eb2723db0311310e487d865794d @polyethene committed Nov 13, 2010
Showing with 17 additions and 48 deletions.
  1. +17 −2 Deploy/Bundle.cs
  2. +0 −3 Deploy/Deploy.csproj
  3. +0 −43 Deploy/MacOS.sh
View
@@ -29,8 +29,23 @@ static void AppBundle()
if (!Directory.Exists(osx))
Directory.CreateDirectory(osx);
- const string sh = "MacOS.sh";
- File.Copy(sh, Path.Combine(osx, Name));
+ using (var writer = new StreamWriter(Path.Combine(osx, Name)))
+ {
+ writer.NewLine = "\n";
+ writer.WriteLine("#!/bin/sh");
+ writer.WriteLine("PWD=`pwd`");
+ writer.WriteLine("APP_PATH=`echo $0 | awk '{split($0,patharr,\"/\"); idx=1; while(patharr[idx+3] != \"\") { if (patharr[idx] != \"/\") {printf(\"%s/\", patharr[idx]); idx++ }} }'`");
+ writer.WriteLine("APP_NAME=`echo $0 | awk '{split($0,patharr,\"/\"); idx=1; while(patharr[idx+1] != \"\") {idx++} printf(\"%s\", patharr[idx]); }'`");
+ writer.WriteLine("ASSEMBLY=`echo $0 | awk '{split($0,patharr,\"/\"); idx=1; while(patharr[idx+1] != \"\") {idx++} printf(\"%s.exe\", patharr[idx]); }'`");
+ writer.WriteLine("export MONO_MWF_USE_CARBON_BACKEND=1");
+ writer.WriteLine("export GDIPLUS_NOX=1");
+ writer.WriteLine("cd \"$APP_PATH/Contents/Resources\"");
+ writer.WriteLine("if [ ! -d \"./bin\" ]; then mkdir bin ; fi");
+ writer.WriteLine("if [ -f \"./bin/$APP_NAME\" ]; then rm -f \"./bin/$APP_NAME\" ; fi");
+ writer.WriteLine("ln -s `which mono` \"./bin/$APP_NAME\" ");
+ writer.WriteLine("\"./bin/$APP_NAME\" \"$ASSEMBLY\"");
+ }
+
using (var writer = new StreamWriter(Path.Combine(root, "Info.plist")))
{
View
@@ -106,9 +106,6 @@
<None Include="license.rtf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="MacOS.sh">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="setup.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
View
@@ -1,43 +0,0 @@
-#!/bin/sh
-#
-# This is a stub script that allows .apps to be relocatable on OSX but still
-# find the managed assembly.
-#
-# You should never have to edit this file directly as its generated by the
-# bundle maker.
-#
-
-X11_MODE=0
-MWF_MODE=1
-COCOASHARP_MODE=0
-
-PWD=`pwd`
-# Fetch the path relative to the launch point where this shell script exists.
-APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
-
-# Fetch the app name (its our own name)
-APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] != "") {idx++} printf("%s", patharr[idx]); }'`
-ASSEMBLY=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] != "") {idx++} printf("%s.exe", patharr[idx]); }'`
-
-# Setup the environment for MWF if needed
-if [ "$MWF_MODE" -eq "1" ]; then
- export MONO_MWF_USE_CARBON_BACKEND=1
- export GDIPLUS_NOX=1
-fi
-
-# Setup the environment for Cocoa# if needed
-if [ "$COCOASHARP_MODE" -eq "1" ]; then
- export MONO_GDIP_USE_COCOA_BACKEND=1
- export DYLD_LIBRARY_PATH=$PWD/$APP_PATH/Contents/Resources:$DYLD_LIBRARY_PATH
-fi
-
-cd "$APP_PATH/Contents/Resources"
-
-if [ "$X11_MODE" -eq "1" ]; then
- open-x11 "$APP_NAME"
-else
- if [ ! -d "./bin" ]; then mkdir bin ; fi
- if [ -f "./bin/$APP_NAME" ]; then rm -f "./bin/$APP_NAME" ; fi
- ln -s `which mono` "./bin/$APP_NAME"
- "./bin/$APP_NAME" "$ASSEMBLY"
-fi

0 comments on commit 66315c8

Please sign in to comment.