Skip to content

Commit b319c71

Browse files
committed
chore: refactored package function to support both :package and :desktop_package configs
### CHANGES - Added support for `:desktop_package` configuration - Replaced `case` statement with `cond` for better readability - Improved handling of default package configuration - Updated warning message for missing package config - Simplified logic flow for package configuration selection
1 parent 29aa9b2 commit b319c71

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

lib/deployment.ex

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ defmodule Desktop.Deployment do
66
def package(rel \\ nil) do
77
config = Mix.Project.config()
88

9-
case config[:package] do
10-
nil ->
9+
cond do
10+
config[:package] != nil ->
11+
struct!(default_package(rel), config[:package])
12+
13+
config[:desktop_package] != nil ->
14+
struct!(default_package(rel), config[:desktop_package])
15+
16+
true ->
1117
Logger.warning(
1218
"There is no package config defined. Using the generic Elixir App descriptions."
1319
)
1420

1521
default_package(rel)
16-
17-
map ->
18-
struct!(default_package(rel), map)
1922
end
2023
end
2124

0 commit comments

Comments
 (0)