Added sudo -v to update within .bash_aliases
This commit is contained in:
parent
84ffed1750
commit
886d3c259d
@ -58,7 +58,7 @@ function gac() {
|
|||||||
if [ -d ".git" ]; then
|
if [ -d ".git" ]; then
|
||||||
echo "Log Message: "
|
echo "Log Message: "
|
||||||
read logmessage
|
read logmessage
|
||||||
git add . --all && git commit --allow-empty-message -m "$logmessage"
|
git add --all && git commit --allow-empty-message -m "$logmessage"
|
||||||
else
|
else
|
||||||
echo "No .git Folder found in Directory. Are you in the Correct Folder?"
|
echo "No .git Folder found in Directory. Are you in the Correct Folder?"
|
||||||
fi
|
fi
|
||||||
@ -73,12 +73,12 @@ function pullall() {
|
|||||||
cd "$dir" || exit 1
|
cd "$dir" || exit 1
|
||||||
# If it's a git directory, then update it
|
# If it's a git directory, then update it
|
||||||
if test -d .git; then
|
if test -d .git; then
|
||||||
|
# Check if its Master or Main
|
||||||
if [ "$(grep -c -i ""master"" .git/config )" -gt 0 ]; then
|
if [ "$(grep -c -i ""master"" .git/config )" -gt 0 ]; then
|
||||||
echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo ""
|
echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo ""
|
||||||
|
|
||||||
elif [ "$(grep -c -i ""main"" .git/config )" -gt 0 ]; then
|
elif [ "$(grep -c -i ""main"" .git/config )" -gt 0 ]; then
|
||||||
echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo ""
|
echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo ""
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "$dir is not a Git repo." && echo ""
|
echo "$dir is not a Git repo." && echo ""
|
||||||
@ -89,7 +89,9 @@ function pullall() {
|
|||||||
|
|
||||||
# Updates packages from all sources
|
# Updates packages from all sources
|
||||||
function update() {
|
function update() {
|
||||||
if command -v snap >/dev/null; then
|
sudo -v
|
||||||
|
|
||||||
|
if command -v snap >/dev/null; then
|
||||||
echo "Updating Snaps..."
|
echo "Updating Snaps..."
|
||||||
sudo snap refresh
|
sudo snap refresh
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user