Commit fe70921a authored by John van Groningen's avatar John van Groningen

if BatchBuild is stored in a directory called 'bin', set the startup directory...

if BatchBuild is stored in a directory called 'bin', set the startup directory to the parent directory
of the bin directory, except on windows
 
parent c71f3249
......@@ -7,7 +7,7 @@ import PmProject
import IdeState
from UtilIO import GetFullApplicationPath,GetLongPathName
import PmEnvironment, logfile, set_return_code
from Platform import application_path,EnvsDirName
from Platform import application_path,EnvsDirName,IF_WINDOWS,DirSeparator,DirSeparatorString
Start world
# commandline = getCommandLine
......@@ -20,9 +20,12 @@ Start world
-> (True,True,GetLongPathName prj)
_
-> (False,False,"")
# (startup,world) = accFiles GetFullApplicationPath world
# envspath = application_path (EnvsDirName+++EnvsFileName)
# (envs,world) = openEnvironments startup envspath world
(startup,world) = accFiles GetFullApplicationPath world
startup = IF_WINDOWS startup (remove_dir_separator_bin_at_end startup)
envspath = IF_WINDOWS
(application_path (EnvsDirName+++EnvsFileName))
(startup+++(DirSeparatorString+++EnvsDirName+++EnvsFileName))
(envs,world) = openEnvironments startup envspath world
// | not ok = wAbort ("Unable to read environments\n") world
| not path_ok = wAbort ("BatchBuild\nUse as: 'BatchBuild [--force] projectname.prj'\n") world
# ((proj,ok,err),world) = accFiles (ReadProjectFile proj_path startup) world
......@@ -35,6 +38,13 @@ Start world
# {ls,gst_world} = pinit force_rebuild ps
= finish gst_world
remove_dir_separator_bin_at_end :: !{#Char} -> {#Char}
remove_dir_separator_bin_at_end s
# size_s = size s
| size_s>=4 && s.[size_s-4]==DirSeparator && s.[size_s-3]=='b' && s.[size_s-2]=='i' && s.[size_s-1]=='n'
= s % (0,size_s-5)
= s
pinit force_rebuild ps
= BringProjectUptoDate force_rebuild cleanup ps
where
......@@ -48,4 +58,3 @@ wAbort message world
= finish world
finish w = w
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment