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.

54 lines
1.7 KiB

2 years ago
2 years ago
  1. trap 'echo "Interrupted";
  2. rm main;
  3. cp employeeLogin.c.bak employeeLogin.c;
  4. cp mainMenu.c.bak mainMenu.c;
  5. cp createEmployeeAccount.c.bak createEmployeeAccount.c;
  6. cp _file_information.h.bak _file_information.h;
  7. rm employeeLogin.c.bak;
  8. rm mainMenu.c.bak;
  9. rm createEmployeeAccount.c.bak;
  10. rm _file_information.h.bak;
  11. cd ..;
  12. rm -r build; exit' SIGINT
  13. clear
  14. ceedling test:all
  15. rm -r build/
  16. cd src/
  17. sed '/John Doe/,$d' employeesCredentialsList.txt > temp.txt
  18. mv temp.txt employeesCredentialsList.txt
  19. sed '/Name : John/,$d' employeesData.txt > temp.txt
  20. mv temp.txt employeesData.txt
  21. # backup files
  22. for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
  23. cp "$file" "$file.bak"
  24. done
  25. # remove 'src/'
  26. for file in employeeLogin.c createEmployeeAccount.c _file_information.h; do
  27. sed -i 's/src\///g' "$file"
  28. done
  29. 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
  30. ./main
  31. rm main
  32. # restore backups
  33. for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
  34. cp "$file.bak" "$file"
  35. done
  36. # remove backups
  37. for file in employeeLogin.c.bak mainMenu.c.bak createEmployeeAccount.c.bak _file_information.h.bak; do
  38. rm "$file"
  39. done
  40. cd ..