Skip to content

Commit 9d454a7

Browse files
committed
[fix] : Fixed package check format
1 parent 609362f commit 9d454a7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ prepare_env() {
359359
msg_debug -n "Checking ${_pkg} ..."
360360
_version="$("${tools_dir}/package.py" -s "${_pkg}")" || _result="${?}"
361361
case "${_result}" in
362-
"0")
362+
"0" | "1")
363363
[[ "${debug}" = true ]] && echo -ne " ${_version}\n"
364364
;;
365365
"1")
@@ -368,8 +368,7 @@ prepare_env() {
368368
"2")
369369
_local="$(echo "${_version}" | getclm 1)"
370370
_latest="$(echo "${_version}" | getclm 2)"
371-
[[ "${debug}" = true ]] && echo -ne " ${_result[1]}\n"
372-
msg_warn "The version of ${_pkg} installed in local does not match one of the latest.\nLocal: ${_local} Latest: ${_latest}"
371+
echo; msg_warn "The version of ${_pkg} installed in local does not match one of the latest.\nLocal: ${_local} Latest: ${_latest}"
373372
;;
374373
"3")
375374
[[ "${debug}" = true ]] && echo

tools/package.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def compare(package: str) -> tuple[int,Optional[tuple[str]]]:
7272
elif not pkg_from_sync:
7373
msg(f"Failed to get the latest version of {package}.", "warn")
7474

75-
return (2, None)
75+
return (1, (pkg_from_local.version))
7676

7777
if pkg_from_local.version == pkg_from_sync.version:
7878
msg(f"The latest version of {package} is installed.", "info")
@@ -82,7 +82,7 @@ def compare(package: str) -> tuple[int,Optional[tuple[str]]]:
8282
msg(f"The version of {package} does not match one of the latest.", "warn")
8383
msg(f"Local: {pkg_from_local.version} Latest: {pkg_from_sync.version}", "warn")
8484

85-
return (1, (pkg_from_local.version, pkg_from_sync.version))
85+
return (2, (pkg_from_local.version, pkg_from_sync.version))
8686

8787

8888
if __name__ == "__main__":
@@ -125,6 +125,6 @@ def compare(package: str) -> tuple[int,Optional[tuple[str]]]:
125125
exit_code, info = compare(args.package)
126126

127127
if args.script and info:
128-
print(" ".join(info))
128+
print(info)
129129

130130
sys.exit(exit_code)

0 commit comments

Comments
 (0)