#!/bin/bash function get_branch() { git symbolic-ref --short -q HEAD || echo "main"; } modules=('Cancer' 'Pharmacy' 'Payroll' 'PatientFinance' 'PatientDiscounts' 'Maternity' 'Journals' 'Invoices' 'Investigations' 'Insurance' 'Hiv' 'FinanceReports' 'Finance' 'EyeClinic' 'Expenses' 'Diabetes' 'Budgets' 'Banking' 'Antenatal' 'Stores' 'Theatre' 'Reports' 'WardManagement') for module in "${modules[@]}"; do echo "Status: ${module}" cd Modules/"$module" || continue branch_name=`get_branch`; git pull origin "${branch_name}" cd ../../ done echo "Status: Updating main" branch_name=`get_branch`; git pull origin "${branch_name}" php artisan migrate php artisan db:seed --class=PermissionTableSeeder php artisan db:seed --class=PermissionsCategoryTableSeeder composer install