Closed metaist closed 1 month ago
The updater should accept environment variables to override it's baked-in values. Maybe: COSMOFY_URL_RELEASE
,
COSMOFY_URL_METADATA
(which defaults to COSMOFY_URL_RELEASE
+ ".json")
So merely sticking this url in .args
is insufficient because I also need to know the date this file was built. I could go off of mdate
but that feels risky. Instead, I'll embed a .cosmofy.json
into the output that has the URL and the date.
Oh, wait. updater.py
doesn't have ZipFile2
, so I'll need to use the regular zipfile
to read the file contents.
Inject the updater into
Lib/site-packages
and route CLI args through its main to check for--self-update
args (which trigger self-updating behavior)..args
cosmofy.updater
at the endcosmofy.updater.main()
to process argumentsSupport the following bits of the python interface:
-c
viaexec
-m
viarunpy
-V, --version
:import sys; print("Python " + ".".join(str(x) for x in sys.version_info[:3]))
-
to read fromsys.stdin
<script>
to read from the filesystem