Skip to content

Commit 3ca240e

Browse files
committed
fix: Do not show packages installed under the old system
Additionally, show a warning telling users to reinstall all their packages
1 parent 8cddf0b commit 3ca240e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/lib/commands/do-list.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ do-list() {
1111
esac
1212
done
1313

14+
local has_invalid_packages='no'
15+
1416
if [ "$should_show_outdated" = 'yes' ]; then
1517
local packages
1618
readarray -t packages < <(do-list)
@@ -37,7 +39,19 @@ do-list() {
3739
local repository="${package_path##*/}"
3840
local package="$user/$repository"
3941

42+
# Users that have installed packages before the switch to namespacing by
43+
# site domain name will print incorrectly. So, we check to make sure the site
44+
# url is actually is a domain name and not, for example, a GitHub username
45+
if [[ "$site" != *.* ]]; then
46+
has_invalid_packages='yes'
47+
continue
48+
fi
49+
4050
printf "%s\n" "$site/$package"
4151
done
4252
fi
53+
54+
if [ "$has_invalid_packages" = 'yes' ]; then
55+
log.error "You have invalid packages. To fix this optimally, remove the '${BPM_PACKAGES_PATH%/*}' directory and reinstall all that packages that were deleted in the process"
56+
fi
4357
}

0 commit comments

Comments
 (0)