We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c4dcea commit 0b23db1Copy full SHA for 0b23db1
src/common.sh
@@ -12,7 +12,11 @@ function is_installed(){
12
function is_in_apt(){
13
# Checks if a package is in the apt repo, returns 1 if exists and 0 if not
14
# Usage is_in_apt <package_name>
15
- if [ $(apt-cache policy $1 | wc | awk '{print $1}') -gt 0 ]; then
+
16
+ local output
17
+ output=$(apt-cache search --names-only "^${1}$")
18
19
+ if [ -n "$output" ]; then
20
echo 1
21
else
22
echo 0
0 commit comments