You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

2 years ago
2 years ago
  1. #this build script was created to compile all the files and run the tests accordingly and also run the files that cant be compiled by ceedling
  2. trap 'echo "Interrupted";
  3. rm main;
  4. cp employeeLogin.c.bak employeeLogin.c;
  5. cp mainMenu.c.bak mainMenu.c;
  6. cp createEmployeeAccount.c.bak createEmployeeAccount.c;
  7. cp _file_information.h.bak _file_information.h;
  8. rm employeeLogin.c.bak;
  9. rm mainMenu.c.bak;
  10. rm createEmployeeAccount.c.bak;
  11. rm _file_information.h.bak;
  12. cd ..;
  13. rm -r build; exit' SIGINT
  14. clear
  15. ceedling test:all
  16. rm -r build/
  17. cd src/
  18. sed '/John Doe/,$d' employeesCredentialsList.txt > temp.txt
  19. mv temp.txt employeesCredentialsList.txt
  20. sed '/Name : John/,$d' employeesData.txt > temp.txt
  21. mv temp.txt employeesData.txt
  22. # backup files
  23. for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
  24. cp "$file" "$file.bak"
  25. done
  26. # remove 'src/'
  27. for file in employeeLogin.c createEmployeeAccount.c _file_information.h; do
  28. sed -i 's/src\///g' "$file"
  29. done
  30. gcc mainMenu.c error.c createEmployeeAccount.c showGeneralInfoEmployee.c employeeLogin.c createCustomer.c helperFunctions.c loginCustomer.c customerMenu.c main.c calculatorAdd.c calculatorDivide.c calculatorFactorial.c calculatorGetUserInput.c calculatorGetUserInputFactorial.c calculatorMultiply.c calculatorSubtract.c displayMenuCalculator.c checkLoanEligibility.c currencyExchange.c currentCustomerAccountBalance.c depositMoney.c displayDisclaimer.c interestCalculator.c requestLoan.c sendMoney.c updateCustomerAccountBalance.c withdrawMoney.c -o main
  31. ./main
  32. rm main
  33. # restore backups
  34. for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
  35. cp "$file.bak" "$file"
  36. done
  37. # remove backups
  38. for file in employeeLogin.c.bak mainMenu.c.bak createEmployeeAccount.c.bak _file_information.h.bak; do
  39. rm "$file"
  40. done
  41. cd ..