Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Improve Bash script based on feedback #185

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Adriel007
Copy link

Script Documentation

This document outlines the improvements made to the Bash script based on the provided feedback.

Error Handling

  • Previously, the script used set -o errexit and set -o pipefail, ensuring better error handling. However, the variable fail was used without initialization. Now, fail is initialized before usage.

Directory Path Handling

  • Instead of using find, which can be problematic with spaces in file or directory names, a while loop with read is utilized. The IFS (Internal Field Separator) is modified to handle spaces.

Temporary File Handling

  • It's considered a good practice to use temporary files to store intermediate results. While not directly implemented here, it's recommended.

Directory Validation

  • Validation of directories before usage can prevent unexpected errors. This validation has been added after changing to the project's root directory.

Command and Go Installation Validation

  • Although not directly implemented here, it's suggested to add checks to ensure the availability of commands like gover, git and go, as well as proper installation of Go.

Script Changes Summary

  • Initialized the fail variable locally before usage.
  • Replaced find with a while loop to handle directory paths with spaces.
  • Added validation after changing to the project's root directory.

Script Overview

The script performs the following tasks:

  1. Changes to the project's root directory.
  2. Generates coverage files.
  3. Combines coverage reports.

Note: It's advisable to further enhance the script with command and Go installation validation checks.

This commit enhances the Bash script according to provided feedback:
- Improved error handling by initializing the 'fail' variable before usage.
- Replaced 'find' with a 'while' loop to handle directory paths with spaces.
- Added validation after changing to the project's root directory.
- Updated documentation to reflect the changes made.

Further enhancements, such as command and Go installation validation checks, are recommended.
@oke11o
Copy link
Collaborator

oke11o commented Apr 23, 2024

Hi Adriel!
Our product doesn't use Travis ci anymore. And this script used only in travic ci.
I think we have to remove any mentions of travis

@Adriel007
Copy link
Author

Hi Adriel!
Our product doesn't use Travis ci anymore. And this script used only in travic ci.
I think we have to remove any mentions of travis

Ah, okay, thanks for the advice

@Adriel007
Copy link
Author

I just fixed and pushed the commit.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants