2
0
Эх сурвалжийг харах

Squashed 'src/ted2go/' changes from b48521ef..7c09d8d5

7c09d8d5 More first run cd fixes.

git-subtree-dir: src/ted2go
git-subtree-split: 7c09d8d58cac577140894fbf081d67d119d4ee3e
Mark Sibly 8 жил өмнө
parent
commit
9ab429574c
1 өөрчлөгдсөн 6 нэмэгдсэн , 11 устгасан
  1. 6 11
      Ted2.monkey2

+ 6 - 11
Ted2.monkey2

@@ -127,18 +127,16 @@ Function Main()
 	Local root:=Prefs.MonkeyRootPath
 	If Not root Then root=AppDir()
 	
-	' return real folder or empty string
-	Local path:=SetupMonkeyRootPath( root,True )
-	If Not path
-		libc.exit_( 1 )
-		Return
-	Endif
+	root=SetupMonkeyRootPath( root,True )
+	If Not root libc.exit_( 1 )
 	
-	If path<>root
-		Prefs.MonkeyRootPath=path
+	If root<>Prefs.MonkeyRootPath
+		Prefs.MonkeyRootPath=root
 		Prefs.SaveLocalState()
 	Endif
 	
+	ChangeDir( root )
+	
 	'load ted2 state
 	'
 	Local jobj:=JsonObject.Load( "bin/ted2.state.json" )
@@ -196,9 +194,6 @@ Function SetupMonkeyRootPath:String( rootPath:String,searchMode:Bool )
 	
 #If __DESKTOP_TARGET__
 
-'	Not needed, and messes up default dir on first run.	
-'	ChangeDir( rootPath )
-	
 	If searchMode
 		' search for desired folder
 		Local found:=FindBinFolder( rootPath )