Commit f73a0d88 authored by Jurrien Stutterheim's avatar Jurrien Stutterheim

CPM is expected to be placed in $CLEAN_HOME/bin and it will look for an IDEEnvs

file in $CLEAN_HOME/etc
parent 86f5c80e
......@@ -20,7 +20,7 @@ import UtilIO
/**
* Clean Platform imports
*/
import System.CommandLine, System.Environment, System.Directory
import System.CommandLine, System.Environment, System.Directory, System.FilePath
import Data.Error, Data.Func, Data.List
import Text
......@@ -38,10 +38,11 @@ Start world
# (cmd, world) = getCommandLine world
(mpwd, world) = getCurrentDirectory world
(cpmd, world) = accFiles GetFullApplicationPath world
cleandir = if (endsWith "bin" cpmd) (takeDirectory cpmd) cpmd
(ch, world) = case getEnvironmentVariable "CLEAN_HOME" world of
(Just ch, world) -> (ch, world)
(_, world) -> (cpmd, world)
(_, world) -> (cleandir, world)
= case mpwd of
Ok pwd -> doCpmAction ch pwd (startParse (fromString $ mkCl cmd)) world
Ok pwd -> doCpmAction cleandir pwd (startParse (fromString $ mkCl cmd)) world
Error e -> abort "Failed to read current directory"
where mkCl cmd = concat (intersperse " " (tl [fromString arg \\ arg <- cmd]))
......@@ -111,7 +111,7 @@ doProjectAction cleanhome pwd pn ShowProject world
] world
doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world
# (envs, world) = openEnvironments cleanhome (cleanhome </> ideenvs) world
# (envs, world) = openEnvironments cleanhome (cleanhome </> "etc" </> ideenvs) world
# ((proj, ok, err), world) = accFiles (ReadProjectFile proj_path cleanhome) world
| not ok || err <> "" = error ("CPM failed while opening project: " +++ err +++ "\n") world
# (console, world) = stdio world
......
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