Browse Source

moved monkpath to appdir contents for mac

nitrologic 10 years ago
parent
commit
be44e14ec1
3 changed files with 71 additions and 15 deletions
  1. 28 0
      MonkDebugInfo.plist
  2. 28 0
      MonkInfo.plist
  3. 15 15
      monk.bmx

+ 28 - 0
MonkDebugInfo.plist

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+			<string>monkey</string>
+			<string>bmx</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>monk.icns</string>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>LSIsAppleDefaultForType</key>
+			<true/>
+		</dict>
+	</array>
+	<key>CFBundleExecutable</key>
+	<string>monk.debug</string>
+	<key>CFBundleIconFile</key>
+	<string>monk.icns</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+</dict>
+</plist>

+ 28 - 0
MonkInfo.plist

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+			<string>monkey</string>
+			<string>bmx</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>monk.icns</string>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>LSIsAppleDefaultForType</key>
+			<true/>
+		</dict>
+	</array>
+	<key>CFBundleExecutable</key>
+	<string>monk</string>
+	<key>CFBundleIconFile</key>
+	<string>monk.icns</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+</dict>
+</plist>

+ 15 - 15
monk.bmx

@@ -18,8 +18,8 @@ Import brl.retro
 
 
 Import pub.stdc
 Import pub.stdc
 
 
-' added .md markdown suffix
-' 
+' added .md markdown and .sh script to filter
+' modified monkpath to use appdir contents folder 
 
 
 ?Win32
 ?Win32
 Import "monk.o"
 Import "monk.o"
@@ -43,7 +43,7 @@ Global BCC_VERSION$="{unknown}"	'not valid until codeplay opened
 
 
 Const EOL$="~n"
 Const EOL$="~n"
 
 
-Const FileTypes$="monkey,bmx,bbdoc,txt,ini,md,doc,plist,bb,cpp,c,cc,m,cxx,s,glsl,hlsl,lua,py,h,hpp,html,htm,css,js,bat,mm,as,java,bbx,cs,xml,properties,template"
+Const FileTypes$="monkey,bmx,bbdoc,txt,ini,md,doc,plist,bb,cpp,c,cc,m,cxx,s,glsl,hlsl,lua,py,h,hpp,html,htm,css,js,bat,sh,mm,as,java,bbx,cs,xml,properties,template"
 Const FileTypeFilters$="Code Files:"+FileTypes$+";All Files:*"
 Const FileTypeFilters$="Code Files:"+FileTypes$+";All Files:*"
 
 
 Const WIKI_URL$="http://blitz-wiki.appspot.com/"
 Const WIKI_URL$="http://blitz-wiki.appspot.com/"
@@ -6216,6 +6216,7 @@ Type TCodePlay
 ' read ini
 ' read ini
 		stream=ReadFile(inipath)
 		stream=ReadFile(inipath)
 		If Not stream
 		If Not stream
+			Notify "ini file failed to read:"+inipath
 			AddDefaultProj "monkey|."
 			AddDefaultProj "monkey|."
 			Return
 			Return
 		EndIf
 		EndIf
@@ -6276,12 +6277,15 @@ Type TCodePlay
 	End Method
 	End Method
 	
 	
 	Method WriteConfig()
 	Method WriteConfig()
-		Local	panel:TToolPanel
-		Local	node:TNode
-		Local	f$
+		Local panel:TToolPanel
+		Local node:TNode
+		Local f$
 		
 		
-		Local	stream:TStream = WriteFile(inipath)
-		If Not stream Return
+		Local stream:TStream = WriteFile(inipath)
+		If Not stream 
+			Notify "Failed to write inipath:"+inipath
+			Return
+		EndIf
 ' options
 ' options
 		options.Write(stream)
 		options.Write(stream)
 ' defaults		
 ' defaults		
@@ -6792,14 +6796,10 @@ Type TCodePlay
 		Local	stream:TStream
 		Local	stream:TStream
 
 
 		monkpath=AppDir
 		monkpath=AppDir
-		CreateDir monkpath+"/tmp"
-		If FileType( monkpath+"/tmp" )<>FILETYPE_DIR
-			Notify "Unable to create Monk 'tmp' directory."
-			End
-		EndIf
-				
+?macos
+		monkpath=RealPath(AppFile+"/../..")
+?								
 		inipath=monkpath+"/monk."+ComputerName$()+".ini"
 		inipath=monkpath+"/monk."+ComputerName$()+".ini"
-				
 		window=CreateWindow("Monk",20,20,760,540,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_STATUS|WINDOW_HIDDEN|WINDOW_ACCEPTFILES|WINDOW_MENU)
 		window=CreateWindow("Monk",20,20,760,540,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_STATUS|WINDOW_HIDDEN|WINDOW_ACCEPTFILES|WINDOW_MENU)
 		
 		
 		?Linux
 		?Linux