mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-10 08:07:01 -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
|
||||
|
||||
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() {
|
||||
# Test if age is installed
|
||||
command -v age >/dev/null 2>&1 && return
|
||||
|
||||
# Install age
|
||||
apt_update
|
||||
sudo apt install age
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user