Skip to content

Commit

Permalink
Fix data object errors
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj-hrivnak committed Dec 13, 2024
1 parent 6927a4e commit 8c80429
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ suspend fun Project?.createAdditionRequest(
)
{
// Exist
if (this == null) return onError(ProjNotFound())
if (this == null) return onError(ProjNotFound)

var isRecommended = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ suspend fun Project?.createRemovalRequest(
lockFile: LockFile,
)
{
if (this == null) return onError(ProjNotFound())
if (this == null) return onError(ProjNotFound)

val dependants = lockFile.getLinkedProjects(this.pakkuId!!, ignore = this)

Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Add.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Add : CliktCommand()

val (promptedProject, promptedArg) = prompt

if (promptedProject == null) return terminal.pError(ProjNotFound(), promptedArg.rawArg)
if (promptedProject == null) return terminal.pError(ProjNotFound, promptedArg.rawArg)

(error.project + promptedProject).fold( // Combine projects
failure = { terminal.pError(it) },
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/teksturepako/pakku/cli/cmd/AddPrj.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AddPrj : CliktCommand("prj")

val (promptedProject, promptedArg) = prompt

if (promptedProject == null) return terminal.pError(ProjNotFound(), promptedArg.rawArg)
if (promptedProject == null) return terminal.pError(ProjNotFound, promptedArg.rawArg)

(error.project + promptedProject).resultFold( // Combine projects
failure = { terminal.pError(it) },
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/teksturepako/pakku/cli/cmd/CfgPrj.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CfgPrj : CliktCommand("prj")
val configFile = ConfigFile.readOrNew()

projectArgs.map { arg ->
if (lockFile.getProject(arg) != null) Ok(arg) else Err(ProjNotFound())
if (lockFile.getProject(arg) != null) Ok(arg) else Err(ProjNotFound)
}.mapNotNull { result ->
result.onFailure { terminal.pError(it) }.get()
}.forEach { arg ->
Expand Down

0 comments on commit 8c80429

Please sign in to comment.