mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-10 02:06:59 -06:00
add apt_update step to before-source-state script
This commit is contained in:
@@ -2,11 +2,28 @@
|
|||||||
|
|
||||||
type rbw >/dev/null 2>&1 && exit
|
type rbw >/dev/null 2>&1 && exit
|
||||||
|
|
||||||
|
apt_update() {
|
||||||
|
# Only run apt update once
|
||||||
|
if [ -f /tmp/.apt-updated ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt update
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to update apt"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
touch /tmp/.apt-updated
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
install_age() {
|
install_age() {
|
||||||
# Test if age is installed
|
# Test if age is installed
|
||||||
command -v age >/dev/null 2>&1 && return
|
command -v age >/dev/null 2>&1 && return
|
||||||
|
|
||||||
# Install age
|
# Install age
|
||||||
|
apt_update
|
||||||
sudo apt install age
|
sudo apt install age
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user