mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 03:00:11 +00:00
21 lines
490 B
Bash
21 lines
490 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
function _apt {
|
|
local pkg=$1
|
|
if ! dpkg -s $pkg >/dev/null 2>&1; then
|
|
if [ -z "$__apt_updated" ]; then
|
|
_run "Update APT cache" sudo apt-get update
|
|
__apt_updated=yes
|
|
fi
|
|
_run "[apt] Install $pkg" sudo apt-get install -y $1
|
|
else
|
|
echo "[apt] $pkg is already installed, skipping."
|
|
fi
|
|
}
|
|
|
|
_apt software-properties-common
|
|
|
|
function _ppa {
|
|
_run "[apt] Add PPA: $1" sudo add-apt-repository -u -y ppa:$1
|
|
}
|