mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-26 11:07:48 +03:00
stub out project.create
handler
This commit is contained in:
parent
8c681904fb
commit
e661093bde
@ -155,6 +155,13 @@ packages:
|
||||
sha256: 1981a732d1917213de7f51d26255af733a61918c59eebb6c6f6ca939856839ef
|
||||
original:
|
||||
hackage: network-3.1.2.7
|
||||
- completed:
|
||||
hackage: sqlite-simple-0.4.18.2@sha256:dda1643e723591c880dda8eeba73e93502cfa775078a79da55b5efec4c52ff66,3028
|
||||
pantry-tree:
|
||||
size: 1930
|
||||
sha256: 64443740f279b344aecb3389ec8f69ea04d171916a9ed23f8fa529dd3ae75540
|
||||
original:
|
||||
hackage: sqlite-simple-0.4.18.2
|
||||
snapshots:
|
||||
- completed:
|
||||
size: 590100
|
||||
|
@ -70,6 +70,7 @@ import qualified Unison.Codebase.Editor.AuthorInfo as AuthorInfo
|
||||
import Unison.Codebase.Editor.DisplayObject
|
||||
import qualified Unison.Codebase.Editor.Git as Git
|
||||
import Unison.Codebase.Editor.HandleInput.AuthLogin (authLogin, ensureAuthenticatedWithCodeserver)
|
||||
import Unison.Codebase.Editor.HandleInput.ProjectCreate (projectCreate)
|
||||
import Unison.Codebase.Editor.HandleInput.MetadataUtils (addDefaultMetadata, manageLinks)
|
||||
import Unison.Codebase.Editor.HandleInput.MoveBranch (doMoveBranch)
|
||||
import qualified Unison.Codebase.Editor.HandleInput.NamespaceDependencies as NamespaceDependencies
|
||||
@ -1399,6 +1400,7 @@ loop e = do
|
||||
DiffNamespaceToPatchI diffNamespaceToPatchInput -> do
|
||||
description <- inputDescription input
|
||||
handleDiffNamespaceToPatch description diffNamespaceToPatchInput
|
||||
ProjectCreateI projectName -> projectCreate projectName
|
||||
|
||||
magicMainWatcherString :: String
|
||||
magicMainWatcherString = "main"
|
||||
@ -1573,14 +1575,16 @@ inputDescription input =
|
||||
--
|
||||
ApiI -> wat
|
||||
AuthLoginI {} -> wat
|
||||
ClearI {} -> pure "clear"
|
||||
CreateMessage {} -> wat
|
||||
CreatePullRequestI {} -> wat
|
||||
DebugClearWatchI {} -> wat
|
||||
DebugDoctorI {} -> wat
|
||||
DebugNameDiffI {} -> wat
|
||||
DebugDumpNamespaceSimpleI {} -> wat
|
||||
DebugDumpNamespacesI {} -> wat
|
||||
DebugNameDiffI {} -> wat
|
||||
DebugNumberedArgsI {} -> wat
|
||||
DebugTabCompletionI _input -> wat
|
||||
DebugTypecheckedUnisonFileI {} -> wat
|
||||
DeprecateTermI {} -> wat
|
||||
DeprecateTypeI {} -> wat
|
||||
@ -1598,13 +1602,13 @@ inputDescription input =
|
||||
ListDependentsI {} -> wat
|
||||
ListEditsI {} -> wat
|
||||
LoadI {} -> wat
|
||||
ClearI {} -> pure "clear"
|
||||
NamesI {} -> wat
|
||||
NamespaceDependenciesI {} -> wat
|
||||
PopBranchI {} -> wat
|
||||
PreviewAddI {} -> wat
|
||||
PreviewMergeLocalBranchI {} -> wat
|
||||
PreviewUpdateI {} -> wat
|
||||
ProjectCreateI {} -> wat
|
||||
PushRemoteBranchI {} -> wat
|
||||
QuitI {} -> wat
|
||||
ShowDefinitionByPrefixI {} -> wat
|
||||
@ -1616,7 +1620,6 @@ inputDescription input =
|
||||
UiI -> wat
|
||||
UpI {} -> wat
|
||||
VersionI -> wat
|
||||
DebugTabCompletionI _input -> wat
|
||||
where
|
||||
hp' :: Either SCH.ShortCausalHash Path' -> Cli Text
|
||||
hp' = either (pure . Text.pack . show) p'
|
||||
|
@ -0,0 +1,12 @@
|
||||
-- | @project.create@ input handler
|
||||
module Unison.Codebase.Editor.HandleInput.ProjectCreate
|
||||
( projectCreate,
|
||||
)
|
||||
where
|
||||
|
||||
import Unison.Project (ProjectName)
|
||||
import Unison.Cli.Monad (Cli)
|
||||
|
||||
projectCreate :: ProjectName -> Cli ()
|
||||
projectCreate _projectName = do
|
||||
pure ()
|
@ -209,7 +209,7 @@ data Input
|
||||
| AuthLoginI
|
||||
| VersionI
|
||||
| DiffNamespaceToPatchI DiffNamespaceToPatchInput
|
||||
| CreateProjectI ProjectName
|
||||
| ProjectCreateI ProjectName
|
||||
deriving (Eq, Show)
|
||||
|
||||
data DiffNamespaceToPatchInput = DiffNamespaceToPatchInput
|
||||
|
@ -2350,7 +2350,7 @@ projectCreate =
|
||||
[name] ->
|
||||
case tryInto @ProjectName (Text.pack name) of
|
||||
Left _ -> Left "Invalid project name."
|
||||
Right name1 -> Right (Input.CreateProjectI name1)
|
||||
Right name1 -> Right (Input.ProjectCreateI name1)
|
||||
_ -> Left (showPatternHelp projectCreate)
|
||||
}
|
||||
|
||||
@ -2462,7 +2462,8 @@ validInputs =
|
||||
gist,
|
||||
authLogin,
|
||||
printVersion,
|
||||
diffNamespaceToPatch
|
||||
diffNamespaceToPatch,
|
||||
projectCreate
|
||||
]
|
||||
|
||||
-- | A map of all command patterns by pattern name or alias.
|
||||
|
@ -43,6 +43,7 @@ library
|
||||
Unison.Codebase.Editor.HandleInput.MoveBranch
|
||||
Unison.Codebase.Editor.HandleInput.NamespaceDependencies
|
||||
Unison.Codebase.Editor.HandleInput.NamespaceDiffUtils
|
||||
Unison.Codebase.Editor.HandleInput.ProjectCreate
|
||||
Unison.Codebase.Editor.HandleInput.TermResolution
|
||||
Unison.Codebase.Editor.HandleInput.Update
|
||||
Unison.Codebase.Editor.Input
|
||||
|
Loading…
Reference in New Issue
Block a user