-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.updates.sh
42 lines (37 loc) · 1.07 KB
/
.updates.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
update_node(){
echo "Linux package node is being installed .............. "
nvm install node
echo " Double checking node version .... "
node -v
}
upgrade_linux (){
echo "Linux package are being updated .............. "
sudo apt update && sudo apt upgrade -y
echo "Updater closing ............"
}
### ruby gems update with bundler #####
function gem_update() {
echo "Updating gems >>>"
echo "running bundle update ........"
update_output=$(bundle update)
if [ $? -eq 0 ]; then
echo "Bundle update completed successfully."
else
echo "Error: Bundle update failed."
return 1
fi
if ! git diff --quiet --exit-code Gemfile.lock; then
# Run RuboCop
echo "Running RuboCop..."
rubocop -A
# Commit changes to Gemfile.lock with update output as part of the commit message
echo "Committing changes..."
git add Gemfile.lock
git commit -m "Update gems: ${update_output: -50}"
# Push changes to Git repository
echo "Pushing changes to Git repository..."
git push
else
echo "No changes to commit, git exit "
fi
}