mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-12 04:34:38 +03:00
Rt1 branch uses Rt1 by default
This commit is contained in:
parent
d386787558
commit
27b6cf7bcc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user