From 9010d76505bd2cb3f91d07af16b4c8f69a10f982 Mon Sep 17 00:00:00 2001 From: Ian McLerran Date: Thu, 12 Dec 2024 11:05:02 -0600 Subject: [PATCH] Replace ansi.Ansi imports with ansi.ANSI --- src/AsciiArt.roc | 4 +- src/Model.roc | 8 ++-- src/View.roc | 104 +++++++++++++++++++++++------------------------ src/main.roc | 58 +++++++++++++------------- 4 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/AsciiArt.roc b/src/AsciiArt.roc index 10b1e8f..8714b09 100644 --- a/src/AsciiArt.roc +++ b/src/AsciiArt.roc @@ -1,11 +1,11 @@ module [Art, size, width, height, rocStart, rocSmall, rocLarge, rocStartColored, rocLargeColored, rocSmallColored] -import ansi.Ansi +import ansi.ANSI Art : { height : U16, width : U16, - art : List { text : Str, r : U16, c : U16, color : Ansi.Color }, + art : List { text : Str, r : U16, c : U16, color : ANSI.Color }, } size : List Str -> { width : I32, height : I32 } diff --git a/src/Model.roc b/src/Model.roc index c6db835..8835a34 100644 --- a/src/Model.roc +++ b/src/Model.roc @@ -11,17 +11,17 @@ module [ ] -import ansi.Ansi +import ansi.ANSI Model : { - screen : Ansi.ScreenSize, - cursor : Ansi.CursorPosition, + screen : ANSI.ScreenSize, + cursor : ANSI.CursorPosition, menuRow : U16, pageFirstItem : U64, menu : List Str, fullMenu : List Str, selected : List Str, - inputs : List Ansi.Input, + inputs : List ANSI.Input, packageList : List Str, platformList : List Str, state : State, diff --git a/src/View.roc b/src/View.roc index 7bf6c0e..289238e 100644 --- a/src/View.roc +++ b/src/View.roc @@ -4,12 +4,12 @@ import AsciiArt import BoxStyle exposing [BoxStyle, border] import Controller exposing [UserAction] import Model exposing [Model] -import ansi.Ansi +import ansi.ANSI ## Render functions for each page -renderScreenPrompt = \text -> Ansi.drawText text { r: 1, c: 2, fg: Standard Cyan } -renderExitPrompt = \screen -> Ansi.drawText " Ctrl+C : QUIT " { r: 0, c: screen.width - 17, fg: Standard Red } -renderControlsPrompt = \text, screen -> Ansi.drawText text { r: screen.height - 1, c: 2, fg: Standard Cyan } +renderScreenPrompt = \text -> ANSI.drawText text { r: 1, c: 2, fg: Standard Cyan } +renderExitPrompt = \screen -> ANSI.drawText " Ctrl+C : QUIT " { r: 0, c: screen.width - 17, fg: Standard Red } +renderControlsPrompt = \text, screen -> ANSI.drawText text { r: screen.height - 1, c: 2, fg: Standard Cyan } renderOuterBorder = \screen -> renderBox 0 0 screen.width screen.height (CustomBorder { tl: "╒", t: "═", tr: "╕" }) (Standard Cyan) ## Control prompts for each user action @@ -82,7 +82,7 @@ buildControlPromptStr = \actions, promptsDict -> |> Str.joinWith " | " ## Render a multi-line text with word wrapping -renderMultiLineText : List Str, { startCol : U16, startRow : U16, maxCol : U16, wrapCol : U16, wordDelim ? Str, fg ? Ansi.Color } -> List Ansi.DrawFn +renderMultiLineText : List Str, { startCol : U16, startRow : U16, maxCol : U16, wrapCol : U16, wordDelim ? Str, fg ? ANSI.Color } -> List ANSI.DrawFn renderMultiLineText = \words, { startCol, startRow, maxCol, wrapCol, wordDelim ? " ", fg ? Standard White } -> firstLineWidth = maxCol - startCol consecutiveWidths = maxCol - wrapCol @@ -106,11 +106,11 @@ renderMultiLineText = \words, { startCol, startRow, maxCol, wrapCol, wordDelim ? [] -> [word] List.mapWithIndex lineList \line, idx -> if idx == 0 then - Ansi.drawText line { r: startRow, c: startCol, fg } + ANSI.drawText line { r: startRow, c: startCol, fg } else - Ansi.drawText line { r: startRow + (Num.toU16 idx), c: wrapCol, fg } + ANSI.drawText line { r: startRow + (Num.toU16 idx), c: wrapCol, fg } -renderTypeSelect : Model -> List Ansi.DrawFn +renderTypeSelect : Model -> List ANSI.DrawFn renderTypeSelect = \model -> List.join [ [ @@ -120,13 +120,13 @@ renderTypeSelect = \model -> renderOuterBorder model.screen, [ renderScreenPrompt "WHAT TO START?", - Ansi.drawCursor { fg: Standard Magenta, char: ">" }, + ANSI.drawCursor { fg: Standard Magenta, char: ">" }, ], renderMenu model, ] ## Generate the list of functions to draw the platform select page. -renderPlatformSelect : Model -> List Ansi.DrawFn +renderPlatformSelect : Model -> List ANSI.DrawFn renderPlatformSelect = \model -> List.join [ [ @@ -136,13 +136,13 @@ renderPlatformSelect = \model -> renderOuterBorder model.screen, [ renderScreenPrompt "SELECT A PLATFORM:", - Ansi.drawCursor { fg: Standard Magenta, char: ">" }, + ANSI.drawCursor { fg: Standard Magenta, char: ">" }, ], renderMenu model, ] ## Generate the list of functions to draw the package select page. -renderPackageSelect : Model -> List Ansi.DrawFn +renderPackageSelect : Model -> List ANSI.DrawFn renderPackageSelect = \model -> List.join [ [ @@ -152,14 +152,14 @@ renderPackageSelect = \model -> renderOuterBorder model.screen, [ renderScreenPrompt "SELECT 0+ PACKAGES:", - Ansi.drawCursor { fg: Standard Magenta, char: ">" }, + ANSI.drawCursor { fg: Standard Magenta, char: ">" }, ], renderMultipleChoiceMenu model, ] ## Generate the list of functions to draw the app name input page. -renderInputAppName : Model -> List Ansi.DrawFn +renderInputAppName : Model -> List ANSI.DrawFn renderInputAppName = \model -> when model.state is InputAppName { nameBuffer } -> @@ -169,11 +169,11 @@ renderInputAppName = \model -> renderControlsPrompt (controlsPromptStr model) model.screen, ], renderOuterBorder model.screen, - if List.len nameBuffer == 0 then [Ansi.drawText " (Leave blank for \"main\"):" { r: 1, c: 20, fg: Standard Cyan }] else [], + if List.len nameBuffer == 0 then [ANSI.drawText " (Leave blank for \"main\"):" { r: 1, c: 20, fg: Standard Cyan }] else [], [ renderScreenPrompt "ENTER THE APP NAME:", - Ansi.drawCursor { fg: Standard Magenta, char: ">" }, - Ansi.drawText (nameBuffer |> Str.fromUtf8 |> Result.withDefault "") { r: model.menuRow, c: 4, fg: Standard White }, + ANSI.drawCursor { fg: Standard Magenta, char: ">" }, + ANSI.drawText (nameBuffer |> Str.fromUtf8 |> Result.withDefault "") { r: model.menuRow, c: 4, fg: Standard White }, ], ] @@ -181,7 +181,7 @@ renderInputAppName = \model -> _ -> [] ## Generate the list of functions to draw the search page. -renderSearch : Model -> List Ansi.DrawFn +renderSearch : Model -> List ANSI.DrawFn renderSearch = \model -> when model.state is Search { sender, searchBuffer } -> @@ -194,15 +194,15 @@ renderSearch = \model -> renderOuterBorder model.screen, [ renderScreenPrompt searchPrompt, - Ansi.drawCursor { fg: Standard Magenta, char: ">" }, - Ansi.drawText (searchBuffer |> Str.fromUtf8 |> Result.withDefault "") { r: model.menuRow, c: 4, fg: Standard White }, + ANSI.drawCursor { fg: Standard Magenta, char: ">" }, + ANSI.drawText (searchBuffer |> Str.fromUtf8 |> Result.withDefault "") { r: model.menuRow, c: 4, fg: Standard White }, ], ] _ -> [] ## Generate the list of functions to draw the confirmation page. -renderConfirmation : Model -> List Ansi.DrawFn +renderConfirmation : Model -> List ANSI.DrawFn renderConfirmation = \model -> when model.state is Confirmation { config } -> @@ -216,16 +216,16 @@ renderConfirmation = \model -> if config.type == App then [ renderScreenPrompt "APP CONFIGURATION:", - Ansi.drawText "App name:" { r: model.menuRow, c: 2, fg: Standard Magenta }, - Ansi.drawText config.fileName { r: model.menuRow, c: 12, fg: Standard White }, - Ansi.drawText "Platform:" { r: model.menuRow + 1, c: 2, fg: Standard Magenta }, - Ansi.drawText config.platform { r: model.menuRow + 1, c: 12, fg: Standard White }, - Ansi.drawText "Packages:" { r: model.menuRow + 2, c: 2, fg: Standard Magenta }, + ANSI.drawText "App name:" { r: model.menuRow, c: 2, fg: Standard Magenta }, + ANSI.drawText config.fileName { r: model.menuRow, c: 12, fg: Standard White }, + ANSI.drawText "Platform:" { r: model.menuRow + 1, c: 2, fg: Standard Magenta }, + ANSI.drawText config.platform { r: model.menuRow + 1, c: 12, fg: Standard White }, + ANSI.drawText "Packages:" { r: model.menuRow + 2, c: 2, fg: Standard Magenta }, ] else [ renderScreenPrompt "PACKAGE CONFIGURATION:", - Ansi.drawText "Packages:" { r: model.menuRow, c: 2, fg: Standard Magenta }, + ANSI.drawText "Packages:" { r: model.menuRow, c: 2, fg: Standard Magenta }, ] ), renderMultiLineText config.packages { @@ -241,41 +241,41 @@ renderConfirmation = \model -> _ -> [] ## Generate the list of functions to draw a box. -renderBox : U16, U16, U16, U16, BoxStyle, Ansi.Color -> List Ansi.DrawFn +renderBox : U16, U16, U16, U16, BoxStyle, ANSI.Color -> List ANSI.DrawFn renderBox = \col, row, width, height, style, color -> [ - Ansi.drawHLine { r: row, c: col, len: 1, char: border TopLeft style, fg: color }, - Ansi.drawHLine { r: row, c: col + 1, len: width - 2, char: border Top style, fg: color }, - Ansi.drawHLine { r: row, c: col + width - 1, len: 1, char: border TopRight style, fg: color }, - Ansi.drawVLine { r: row + 1, c: col, len: height - 2, char: border Left style, fg: color }, - Ansi.drawVLine { r: row + 1, c: col + width - 1, len: height - 2, char: border Right style, fg: color }, - Ansi.drawHLine { r: row + height - 1, c: col, len: 1, char: border BotLeft style, fg: color }, - Ansi.drawHLine { r: row + height - 1, c: col + 1, len: width - 2, char: border Bot style, fg: color }, - Ansi.drawHLine { r: row + height - 1, c: col + width - 1, len: 1, char: border BotRight style, fg: color }, + ANSI.drawHLine { r: row, c: col, len: 1, char: border TopLeft style, fg: color }, + ANSI.drawHLine { r: row, c: col + 1, len: width - 2, char: border Top style, fg: color }, + ANSI.drawHLine { r: row, c: col + width - 1, len: 1, char: border TopRight style, fg: color }, + ANSI.drawVLine { r: row + 1, c: col, len: height - 2, char: border Left style, fg: color }, + ANSI.drawVLine { r: row + 1, c: col + width - 1, len: height - 2, char: border Right style, fg: color }, + ANSI.drawHLine { r: row + height - 1, c: col, len: 1, char: border BotLeft style, fg: color }, + ANSI.drawHLine { r: row + height - 1, c: col + 1, len: width - 2, char: border Bot style, fg: color }, + ANSI.drawHLine { r: row + height - 1, c: col + width - 1, len: 1, char: border BotRight style, fg: color }, ] ## Generate the list of functions to draw a single select menu. -renderMenu : Model -> List Ansi.DrawFn +renderMenu : Model -> List ANSI.DrawFn renderMenu = \model -> List.mapWithIndex model.menu \item, idx -> row = Num.toU16 idx + model.menuRow if model.cursor.row == row then - Ansi.drawText "> $(item)" { r: row, c: 2, fg: Standard Magenta } + ANSI.drawText "> $(item)" { r: row, c: 2, fg: Standard Magenta } else - Ansi.drawText "- $(item)" { r: row, c: 2, fg: Default } + ANSI.drawText "- $(item)" { r: row, c: 2, fg: Default } ## Generate the list of functions to draw a multiple choice menu. -renderMultipleChoiceMenu : Model -> List Ansi.DrawFn +renderMultipleChoiceMenu : Model -> List ANSI.DrawFn renderMultipleChoiceMenu = \model -> isSelected = \item -> List.contains model.selected item checkedItems = List.map model.menu \item -> if isSelected item then "[X] $(item)" else "[ ] $(item)" List.mapWithIndex checkedItems \item, idx -> row = Num.toU16 idx + model.menuRow if model.cursor.row == row then - Ansi.drawText "> $(item)" { r: row, c: 2, fg: Standard Magenta } + ANSI.drawText "> $(item)" { r: row, c: 2, fg: Standard Magenta } else - Ansi.drawText "- $(item)" { r: row, c: 2, fg: Default } + ANSI.drawText "- $(item)" { r: row, c: 2, fg: Default } -renderSplash : Model -> List Ansi.DrawFn +renderSplash : Model -> List ANSI.DrawFn renderSplash = \model -> List.join [ [ @@ -286,7 +286,7 @@ renderSplash = \model -> renderSplashBySize model.screen, ] -renderSplashBySize : Ansi.ScreenSize -> List Ansi.DrawFn +renderSplashBySize : ANSI.ScreenSize -> List ANSI.DrawFn renderSplashBySize = \screen -> art = chooseSplashArt screen startRow = (screen.height - art.height) // 2 @@ -296,12 +296,12 @@ renderSplashBySize = \screen -> renderAsciiArt art startRow startCol, ] -renderAsciiArt : AsciiArt.Art, U16, U16 -> List Ansi.DrawFn +renderAsciiArt : AsciiArt.Art, U16, U16 -> List ANSI.DrawFn renderAsciiArt = \art, startRow, startCol -> List.map art.art \elem -> - Ansi.drawText elem.text { r: startRow + elem.r, c: startCol + elem.c, fg: elem.color } + ANSI.drawText elem.text { r: startRow + elem.r, c: startCol + elem.c, fg: elem.color } -chooseSplashArt : Ansi.ScreenSize -> AsciiArt.Art +chooseSplashArt : ANSI.ScreenSize -> AsciiArt.Art chooseSplashArt = \screen -> if (screen.height >= (AsciiArt.rocLargeColored.height + 2)) @@ -316,17 +316,17 @@ chooseSplashArt = \screen -> else AsciiArt.rocStartColored -renderArtAccent : AsciiArt.Art, Ansi.ScreenSize -> List Ansi.DrawFn +renderArtAccent : AsciiArt.Art, ANSI.ScreenSize -> List ANSI.DrawFn renderArtAccent = \art, screen -> startRow = (screen.height - art.height) // 2 startCol = (screen.width - art.width) // 2 if art == AsciiArt.rocLargeColored then List.mapWithIndex AsciiArt.rocStart \line, idx -> - Ansi.drawText line { r: startRow + 30 + Num.toU16 idx, c: startCol + 50, fg: Standard Cyan } + ANSI.drawText line { r: startRow + 30 + Num.toU16 idx, c: startCol + 50, fg: Standard Cyan } else if art == AsciiArt.rocSmallColored then [ - Ansi.drawText "roc start" { r: startRow + 11, c: startCol + 16, fg: Standard Cyan }, - Ansi.drawText "quick start cli" { r: startRow + 12, c: startCol + 16, fg: Standard Cyan }, + ANSI.drawText "roc start" { r: startRow + 11, c: startCol + 16, fg: Standard Cyan }, + ANSI.drawText "quick start cli" { r: startRow + 12, c: startCol + 16, fg: Standard Cyan }, ] else - [Ansi.drawText " quick start cli" { r: startRow + 5, c: startCol, fg: Standard Cyan }] + [ANSI.drawText " quick start cli" { r: startRow + 5, c: startCol, fg: Standard Cyan }] diff --git a/src/main.roc b/src/main.roc index 250bde5..4a22ad1 100644 --- a/src/main.roc +++ b/src/main.roc @@ -10,7 +10,7 @@ import Controller import Model exposing [Model] import Repo exposing [RepositoryEntry, RemoteRepoEntry, CacheRepoEntry] import View -import ansi.Ansi +import ansi.ANSI import cli.Arg import cli.Cmd import cli.Dir @@ -31,8 +31,8 @@ Configuration : { type : [App, Pkg], } -greenCheck = "✔" |> Ansi.color { fg: Standard Green } -redCross = "✖" |> Ansi.color { fg: Standard Red } +greenCheck = "✔" |> ANSI.color { fg: Standard Green } +redCross = "✖" |> ANSI.color { fg: Standard Red } ## The main entry point for the program. main : Task {} _ @@ -105,7 +105,7 @@ runTuiApp = \forceUpdate, showSplash -> else Model.init (Dict.keys repos.platforms) (Dict.keys repos.packages) {} model = Task.loop! initialModel runUiLoop #(Model.init (Dict.keys repos.platforms) (Dict.keys repos.packages) {}) runUiLoop - Stdout.write! (Ansi.toStr Reset) + Stdout.write! (ANSI.toStr Reset) Tty.disableRawMode! {} when model.state is UserExited -> Task.ok {} @@ -118,7 +118,7 @@ runTuiApp = \forceUpdate, showSplash -> createRocFile! config repos Stdout.line "Created $(config.fileName).roc $(greenCheck)" - _ -> Stdout.line ("Oops! Something went wrong..." |> Ansi.color { fg: Standard Yellow }) + _ -> Stdout.line ("Oops! Something went wrong..." |> ANSI.color { fg: Standard Yellow }) ## Run the update tasks for the platform, package, and app-stub repositories. runUpdates : Bool, Bool, Bool -> Task {} _ @@ -140,26 +140,26 @@ runUiLoop : Model -> Task [Step Model, Done Model] _ runUiLoop = \prevModel -> terminalSize = getTerminalSize! model = Controller.paginate { prevModel & screen: terminalSize } - Ansi.drawScreen model (render model) |> Stdout.write! + ANSI.drawScreen model (render model) |> Stdout.write! - input = Stdin.bytes {} |> Task.map! Ansi.parseRawStdin + input = Stdin.bytes {} |> Task.map! ANSI.parseRawStdin modelWithInput = { model & inputs: List.append model.inputs input } handleInput modelWithInput input ## Get the size of the terminal window. ## Author: Luke Boswell -getTerminalSize : Task Ansi.ScreenSize _ +getTerminalSize : Task ANSI.ScreenSize _ getTerminalSize = # Move the cursor to bottom right corner of terminal - cmd = [Cursor (Abs { row: 999, col: 999 }), Cursor (Position (Get))] |> List.map Control |> List.map Ansi.toStr |> Str.joinWith "" + cmd = [Cursor (Abs { row: 999, col: 999 }), Cursor (Position (Get))] |> List.map Control |> List.map ANSI.toStr |> Str.joinWith "" Stdout.write! cmd # Read the cursor position Stdin.bytes {} - |> Task.map Ansi.parseCursor + |> Task.map ANSI.parseCursor |> Task.map! \{ row, col } -> { width: col, height: row } ## Generate the list of draw functions which will be used to draw the screen. -render : Model -> List Ansi.DrawFn +render : Model -> List ANSI.DrawFn render = \model -> when model.state is TypeSelect _ -> View.renderTypeSelect model @@ -172,7 +172,7 @@ render = \model -> _ -> [] ## Dispatch the input to the input handler for the current state. -handleInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleInput = \model, input -> when model.state is TypeSelect _ -> handleTypeSelectInput model input @@ -187,7 +187,7 @@ handleInput = \model, input -> ## Default input handler which ensures that the program can always be exited. ## This ensures that even if you forget to handle input for a state, or end up ## in a state that doesn't have an input handler, the program can still be exited. -handleDefaultInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleDefaultInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleDefaultInput = \model, input -> action = when input is @@ -195,7 +195,7 @@ handleDefaultInput = \model, input -> _ -> None Task.ok (Controller.applyAction { model, action }) -handleTypeSelectInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleTypeSelectInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleTypeSelectInput = \model, input -> action = when input is @@ -213,7 +213,7 @@ handleTypeSelectInput = \model, input -> Task.ok (Controller.applyAction { model, action }) ## The input handler for the PlatformSelect state. -handlePlatformSelectInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handlePlatformSelectInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handlePlatformSelectInput = \model, input -> action = when input is @@ -235,7 +235,7 @@ handlePlatformSelectInput = \model, input -> Task.ok (Controller.applyAction { model, action }) ## The input handler for the PackageSelect state. -handlePackageSelectInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handlePackageSelectInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handlePackageSelectInput = \model, input -> action = when input is @@ -258,7 +258,7 @@ handlePackageSelectInput = \model, input -> Task.ok (Controller.applyAction { model, action }) ## The input handler for the Search state. -handleSearchInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleSearchInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleSearchInput = \model, input -> (action, keyPress) = when input is @@ -276,7 +276,7 @@ handleSearchInput = \model, input -> Task.ok (Controller.applyAction { model, action, keyPress }) ## The input handler for the InputAppName state. -handleInputAppNameInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleInputAppNameInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleInputAppNameInput = \model, input -> bufferLen = when model.state is @@ -297,7 +297,7 @@ handleInputAppNameInput = \model, input -> Task.ok (Controller.applyAction { model, action, keyPress }) ## The input handler for the Confirmation state. -handleConfirmationInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleConfirmationInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleConfirmationInput = \model, input -> action = when input is @@ -307,7 +307,7 @@ handleConfirmationInput = \model, input -> _ -> None Task.ok (Controller.applyAction { model, action }) -handleSplashInput : Model, Ansi.Input -> Task [Step Model, Done Model] _ +handleSplashInput : Model, ANSI.Input -> Task [Step Model, Done Model] _ handleSplashInput = \model, input -> action = when input is @@ -423,12 +423,12 @@ doPackageUpdate = Err GhAuthError -> Stdout.line! redCross - Stdout.line! ("Error: `gh` not authenticated." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: `gh` not authenticated." |> ANSI.color { fg: Standard Yellow }) Task.err GhAuthError Err GhNotInstalled -> Stdout.line! redCross - Stdout.line! ("Error: `gh` not installed." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: `gh` not installed." |> ANSI.color { fg: Standard Yellow }) Task.err GhNotInstalled Err e -> @@ -439,7 +439,7 @@ doPackageUpdate = Stdout.line! "Package update failed. $(redCross)" when e is NetworkErr _ -> - Stdout.line! ("Error: network error." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: network error." |> ANSI.color { fg: Standard Yellow }) Task.err e _ -> @@ -459,12 +459,12 @@ doPlatformUpdate = Err GhAuthError -> Stdout.line! redCross - Stdout.line! ("Error: `gh` not authenticated" |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: `gh` not authenticated" |> ANSI.color { fg: Standard Yellow }) Task.err GhAuthError Err GhNotInstalled -> Stdout.line! redCross - Stdout.line! ("Error: `gh` not installed" |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: `gh` not installed" |> ANSI.color { fg: Standard Yellow }) Task.err GhNotInstalled Err e -> @@ -475,7 +475,7 @@ doPlatformUpdate = Stdout.line! "Platform update failed. $(redCross)" when e is NetworkErr _ -> - Stdout.line! ("Error: network error." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: network error." |> ANSI.color { fg: Standard Yellow }) Task.err e _ -> @@ -493,7 +493,7 @@ doAppStubUpdate = Err _ -> Stdout.line! "App-stub update failed. $(redCross)" - Stdout.line! ("Error: no platforms downloaded. Try updating platforms." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: no platforms downloaded. Try updating platforms." |> ANSI.color { fg: Standard Yellow }) Task.err ErrReadingPlatforms getRemoteRepoData : [Packages, Platforms] -> Task (List RemoteRepoEntry) _ @@ -629,7 +629,7 @@ getAppStubs = \platforms -> when res is Err (NetworkErr _) -> Stdout.line! redCross - Stdout.line! ("Error: network error." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: network error." |> ANSI.color { fg: Standard Yellow }) Err _ -> Stdout.line! redCross @@ -638,7 +638,7 @@ getAppStubs = \platforms -> Stdout.line! greenCheck else Stdout.line! redCross - Stdout.line! ("Error: no platforms downloaded. Try updating platforms." |> Ansi.color { fg: Standard Yellow }) + Stdout.line! ("Error: no platforms downloaded. Try updating platforms." |> ANSI.color { fg: Standard Yellow }) AppStubsLoopState : { platforms : List Str, dir : Str }