Fix crash when creating a project without a proprietary or no license.

This commit is contained in:
Craig Everett 2020-02-10 10:47:35 +09:00
parent 73abd6af5f
commit 07fbd871cd
2 changed files with 4 additions and 3 deletions

Binary file not shown.

View File

@ -47,7 +47,7 @@
-record(project, -record(project,
{type = none :: none | app | lib | cli | gui | escript, {type = none :: none | app | lib | cli | gui | escript,
license = none :: none | none | undefined | string(), license = none :: none | none | skip | string(),
name = none :: none | string(), name = none :: none | string(),
desc = none :: none | string(), desc = none :: none | string(),
repo_url = none :: none | string(), repo_url = none :: none | string(),
@ -1617,6 +1617,7 @@ substitute(Cooked, []) ->
unicode:characters_to_binary(Cooked, utf8). unicode:characters_to_binary(Cooked, utf8).
license(skip) -> "";
license("") -> ""; license("") -> "";
license(Title) -> "-license(\""++ Title ++ "\").". license(Title) -> "-license(\""++ Title ++ "\").".
@ -2396,7 +2397,7 @@ ask_license() ->
{"[skip and leave blank]", skip}], {"[skip and leave blank]", skip}],
case zx_tty:select(Options) of case zx_tty:select(Options) of
skip -> skip ->
""; skip;
proprietary -> proprietary ->
Notice = Notice =
"~nNOTE ON PROPRIETARY USE~n" "~nNOTE ON PROPRIETARY USE~n"
@ -2406,7 +2407,7 @@ ask_license() ->
"If not (mostly when deploying client-side code that links to ZX or " "If not (mostly when deploying client-side code that links to ZX or "
"other GPL/dual-license libraries), Zomp/ZX should be dual-licensed.~n", "other GPL/dual-license libraries), Zomp/ZX should be dual-licensed.~n",
ok = io:format(Notice), ok = io:format(Notice),
""; skip;
License -> License ->
License License
end. end.