mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Also check new path when determining cli_command (#5082)
This commit is contained in:
+7
-2
@@ -49,8 +49,13 @@ if "CERTBOT_AUTO" in os.environ:
|
|||||||
# user saved the script under a different name
|
# user saved the script under a different name
|
||||||
LEAUTO = os.path.basename(os.environ["CERTBOT_AUTO"])
|
LEAUTO = os.path.basename(os.environ["CERTBOT_AUTO"])
|
||||||
|
|
||||||
fragment = os.path.join(".local", "share", "letsencrypt")
|
old_path_fragment = os.path.join(".local", "share", "letsencrypt")
|
||||||
cli_command = LEAUTO if fragment in sys.argv[0] else "certbot"
|
new_path_prefix = os.path.abspath(os.path.join(os.sep, "opt",
|
||||||
|
"eff.org", "certbot", "venv"))
|
||||||
|
if old_path_fragment in sys.argv[0] or sys.argv[0].startswith(new_path_prefix):
|
||||||
|
cli_command = LEAUTO
|
||||||
|
else:
|
||||||
|
cli_command = "certbot"
|
||||||
|
|
||||||
# Argparse's help formatting has a lot of unhelpful peculiarities, so we want
|
# Argparse's help formatting has a lot of unhelpful peculiarities, so we want
|
||||||
# to replace as much of it as we can...
|
# to replace as much of it as we can...
|
||||||
|
|||||||
Reference in New Issue
Block a user