You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run texlua l3build.lua upload --dry-run 1.2.3 and enter dummy announcement, email, and uploader.
(texlua l3build.lua is used to run the latest, perhaps change-contained l3build.lua in cloned repo instead of the one installed from tex distribution.)
Finally one will get
Validation successful.
The local archive is xx minutes old. <<<--- optional
Do you want to upload to CTAN? [y/n]
>
Current logic:
l3build.lua first loads l3build-upload.lua then l3build-variables.lua.
If --dry-run is set, l3build-upload.lua sets ctanupload = false
l3build-variables.lua sets ctanupload = ctanupload or "ask"
But, when --dry-run is set hence ctanupload is false, in loading l3build-variables.lua, ctanupload = ctanupload or "ask" will always reset ctanupload to "ask", because both false and nil are false values.
diff --git a/l3build-variables.lua b/l3build-variables.lua
index 51f9270..a00d7a1 100644
--- a/l3build-variables.lua+++ b/l3build-variables.lua@@ -238,4 +238,8 @@ tdsdirs = tdsdirs or {}
-- Upload settings
curlexe = curlexe or "curl"
uploadconfig = uploadconfig or {}
-ctanupload = ctanupload or "ask"+-- Skip the case when ctanupload == false.+-- This happens when --dry-run is passed.+if ctanupload == nil then+ ctanupload = "ask"+end
The inline version ctanupload = ctanupload == nil and ctanupload or "ask" looks less understandable to me, but if that's more in line with Lua conventions...
The text was updated successfully, but these errors were encountered:
Originally found in pgf workflow run, see https://github.com/hmenke/pgf/actions/runs/3913264885/jobs/6688947232.
To reproduce,
l3build
repol3build ctan
texlua l3build.lua upload --dry-run 1.2.3
and enter dummy announcement, email, and uploader.(
texlua l3build.lua
is used to run the latest, perhaps change-containedl3build.lua
in cloned repo instead of the one installed from tex distribution.)Finally one will get
Current logic:
l3build.lua
first loadsl3build-upload.lua
thenl3build-variables.lua
.--dry-run
is set,l3build-upload.lua
setsctanupload = false
l3build-variables.lua
setsctanupload = ctanupload or "ask"
But, when
--dry-run
is set hencectanupload
is false, in loadingl3build-variables.lua
,ctanupload = ctanupload or "ask"
will always resetctanupload
to"ask"
, because both false and nil are false values.This turns out #247 is not really fixed.
Proposal
The inline version
ctanupload = ctanupload == nil and ctanupload or "ask"
looks less understandable to me, but if that's more in line with Lua conventions...The text was updated successfully, but these errors were encountered: