Skip to content

Commit 5a5d94d

Browse files
Jairo Llopisyajo
authored andcommitted
Change no addons found exit code to 4
It turns out that an arguments syntax error exits with 0x2, which is the same exit code I chose to indicate there are no addons. This way, there's no way to know if there was a real error or there were simply no addons found. So I change the exit code for addons not found to 0x4. Tecnativa/doodba-qa#17 won't be able to complete without this patch. TT21246
1 parent d9bf7f4 commit 5a5d94d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"python.autoComplete.extraPaths": ["./lib", "./tests"],
33
"editor.formatOnSaveTimeout": 1000,
44
"python.formatting.provider": "black",
5+
"python.formatting.blackArgs": [],
56
"python.linting.flake8Args": ["--max-line-length=88"],
67
"python.linting.flake8Enabled": true,
78
"python.linting.pylintEnabled": true,

bin/addons

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ from doodbalib import (
1919
logger,
2020
)
2121

22+
# Exit codes
23+
EXIT_NO_ADDONS = 0x4
24+
2225
# Define CLI options
2326
parser = ArgumentParser(description="Install addons in current environment")
2427
parser.add_argument(
@@ -127,7 +130,7 @@ addons -= without
127130
# Do the required action
128131
if not addons:
129132
print("No addons found", file=sys.stderr)
130-
sys.exit(2)
133+
sys.exit(EXIT_NO_ADDONS)
131134
addons = args.separator.join(sorted(addons))
132135
if args.action == "list":
133136
print(addons)

0 commit comments

Comments
 (0)