Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Martinsos committed Dec 19, 2023
1 parent 231403c commit d94c56a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ data DirBasedTemplateMetadata = DirBasedTemplateMetadata
instance Show StarterTemplate where
show (RemoteStarterTemplate metadata) = _name metadata
show (LocalStarterTemplate metadata) = _name metadata
show AiGeneratedStarterTemplate = "ai-generated 🤖"
show AiGeneratedStarterTemplate = "ai-generated"

instance Interactive.IsOption StarterTemplate where
showOption = show
showOptionDescription (RemoteStarterTemplate metadata) = Just $ _description metadata
showOptionDescription (LocalStarterTemplate metadata) = Just $ _description metadata
showOptionDescription AiGeneratedStarterTemplate =
Just "[experimental 🧪] Describe an app in a couple of sentences and have Wasp AI generate initial code for you."
Just "🤖 Describe an app in a couple of sentences and have Wasp AI generate initial code for you. (experimental)"

getStarterTemplates :: IO [StarterTemplate]
getStarterTemplates = do
Expand Down Expand Up @@ -81,7 +81,7 @@ defaultStarterTemplate =
}

findTemplateByString :: [StarterTemplate] -> String -> Maybe StarterTemplate
findTemplateByString templates query = find ((query `isPrefixOf`) . show) templates
findTemplateByString templates query = find ((== query) . show) templates

readWaspProjectSkeletonFiles :: IO [(Path System (Rel WaspProjectDir) File', Text)]
readWaspProjectSkeletonFiles = do
Expand Down
8 changes: 2 additions & 6 deletions waspc/cli/src/Wasp/Cli/Interactive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ askToChoose question options = do
_invalidIndex -> Nothing

getOptionByName :: String -> Maybe o
getOptionByName name = find ((name `isPrefixOf`) . showOption) options
getOptionByName name = find ((== name) . showOption) options

printErrorAndAskAgain :: IO o
printErrorAndAskAgain = do
Expand All @@ -105,11 +105,7 @@ askToChoose question options = do
optionDescription
]
where
indexPrefix =
Term.applyStyles
([Term.Yellow] <> whenDefault [Term.Bold, Term.Underline])
(showIndex idx)
<> " "
indexPrefix = Term.applyStyles [Term.Yellow] (showIndex idx) <> " "
optionName = Term.applyStyles [Term.Bold] (showOption option)
tags = whenDefault (Term.applyStyles [Term.Yellow] " (default)")
optionDescription = showDescription option
Expand Down
2 changes: 1 addition & 1 deletion waspc/src/Wasp/AI/GenerateNewProject/LogMsg.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ toTermString (Styled s m) =
where
styleToTermStyles = \case
Important -> [Term.Bold, Term.Magenta]
Generating -> [Term.Blue]
Generating -> [Term.Cyan]
Fixing -> [Term.Green]
Error -> [Term.Red]
Custom styles -> styles
Expand Down
2 changes: 1 addition & 1 deletion waspc/src/Wasp/Util/Terminal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ styleCode Cyan = "[36m"
styleCode White = "[37m"
styleCode Bold = "[1m"
styleCode Underline = "[4m"
styleCode Blink = "[5m"
styleCode Blink = "[5m" -- Blink does not work in all terminal emulators (e.g. on mac in iTerm2).

escapeCode :: String
escapeCode = "\ESC"
Expand Down

0 comments on commit d94c56a

Please sign in to comment.