Rt1 branch uses Rt1 by default

This commit is contained in:
Arya Irani 2019-02-23 16:14:53 -05:00
parent d386787558
commit 27b6cf7bcc

View File

@ -2,28 +2,25 @@
module Main where
import Control.Monad ( when )
import qualified Data.Set as Set
import Safe ( headMay )
import System.Environment ( getArgs )
import qualified Unison.Codebase as Codebase
import qualified Unison.Codebase.CommandLine as CommandLine
import qualified Unison.Codebase.FileCodebase as FileCodebase
import Unison.Codebase.Runtime.JVM ( javaRuntime )
import qualified Unison.Codebase.Serialization as S
import Unison.Codebase.Serialization.V0
( formatSymbol
, getSymbol
)
import Unison.Parser ( Ann(External) )
import qualified Unison.Runtime.Rt1 as Rt1
import Control.Monad (when)
import qualified Data.Set as Set
import Safe (headMay)
import System.Environment (getArgs)
import qualified Unison.Codebase as Codebase
import qualified Unison.Codebase.FileCodebase as FileCodebase
import Unison.Codebase.Runtime.JVM (javaRuntime)
import qualified Unison.Codebase.Serialization as S
import Unison.Codebase.Serialization.V0 (formatSymbol, getSymbol)
import qualified Unison.CommandLine.Main as CommandLine
import Unison.Parser (Ann (External))
import qualified Unison.Runtime.Rt1 as Rt1
main :: IO ()
main = do
args0 <- getArgs
let haskellRtFlag = "-haskell"
useHaskellRuntime = haskellRtFlag `elem` args0
args = Set.toList $ Set.delete haskellRtFlag (Set.fromList args0)
let javaRtFlag = "-java"
useJavaRuntime = javaRtFlag `elem` args0
args = Set.toList $ Set.delete javaRtFlag (Set.fromList args0)
-- hSetBuffering stdout NoBuffering -- cool
let codebasePath = ".unison"
initialBranchName = "master"
@ -34,8 +31,9 @@ main = do
scratchFilePath
initialBranchName
(headMay args)
(if useHaskellRuntime then pure Rt1.runtime
else javaRuntime getSymbol 42441)
(if useJavaRuntime
then javaRuntime getSymbol 42441
else pure Rt1.runtime)
theCodebase
exists <- FileCodebase.exists codebasePath
when (not exists) $ do