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.

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