Skip to content

Commit f1fa121

Browse files
committed
add back functions that are still in use
1 parent e754a88 commit f1fa121

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/copilot-cli/install.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ if [ "$(id -u)" -ne 0 ]; then
1616
exit 1
1717
fi
1818

19+
apt_get_update()
20+
{
21+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
22+
echo "Running apt-get update..."
23+
apt-get update -y
24+
fi
25+
}
26+
27+
# Checks if packages are installed and installs them if not
28+
check_packages() {
29+
if ! dpkg -s "$@" > /dev/null 2>&1; then
30+
apt_get_update
31+
apt-get -y install --no-install-recommends "$@"
32+
fi
33+
}
34+
1935
# Figure out correct version of a three part version number is not passed
2036
find_version_from_git_tags() {
2137
local variable_name=$1

0 commit comments

Comments
 (0)