Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactor build.sh: Add OS, Distribution, Version, and Edition Support via CLI with Auto-Continue #968

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ClemTheStudent
Copy link

@ClemTheStudent ClemTheStudent commented Sep 19, 2024

Summary of Pull Request

  • Refactors the build.sh script to support operating system selection, distribution, version, and edition via command-line arguments.
  • Updates the help menu to reflect the new options and parameters.
  • Implements an --auto-continue option to skip manual prompts, enabling smoother automation.

Type of Pull Request

  • This is a bugfix. type/bug
  • This is an enhancement or feature. type/feature
  • This is a refactoring update. type/refactor
  • This is a documentation update. type/docs
  • This is a chore. type/chore
  • This is something else.
    Please describe:

Related to Existing Issues

Closes #969

Test and Documentation Coverage

  • Tests have been completed.
  • Documentation has been added or updated.

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

@vmwclabot
Copy link

@ClemTheStudent, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link

@ClemTheStudent, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

Copy link
Contributor

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for thr contribution!

A couple of nits:

  • Please use English for stdout and comments.
  • Please open and enhancement request and link this pull request to the issue per the contributing guidelines.
  • Please use conventional commits per the contributing guidelines. See the commit history for examples.
  • Please include any testing performed.

build.sh Outdated
select_distribution() {
# Check if the selected guest operating system is Linux or Windows.
if [[ -n "$dist" ]]; then
echo "Distribution sélectionnée : $dist"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use "selection".

build.sh Outdated
@@ -454,7 +507,23 @@ select_distribution() {

# This function selects the version based on the guest operating system's distribution or type.
select_version() {
# Check if the selected guest operating system is Windows.
if [[ -n "$version" ]]; then
echo "Version sélectionnée : $version"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use "selection".

build.sh Outdated
if [[ -n "$version" ]]; then
echo "Version sélectionnée : $version"
if [[ "$dist" == *"Windows"* ]]; then
# Si l'édition est fournie, passer directement à select_build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use comments in English.

build.sh Outdated
@@ -500,6 +568,12 @@ select_version() {
}

select_edition() {
if [[ -n "$edition" ]]; then
echo "Édition sélectionnée : $edition"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use "selection".

build.sh Outdated
esac
done

# Vérification si auto-continue est activé
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use comments in English.

build.sh Outdated
# Vérification si auto-continue est activé
if [ "$auto_continue" = true ]; then
printf "\nAuto-continue is enabled. Skipping user prompt and retrying...\n"
select_version # Continue automatiquement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use comments in English.

build.sh Outdated
while true; do
if [ "$auto_continue" = true ]; then
# Si auto-continue est activé, on continue sans prompt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use comments in English.

@tenthirtyam tenthirtyam added this to the v0.21.0 milestone Sep 19, 2024
@tenthirtyam
Copy link
Contributor

tenthirtyam commented Sep 19, 2024

Marked as draft until CLA is completed.

esac
done

# Check if auto-continue is enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Check if auto-continue is enabled
# Check if auto-continue is enabled.

# Check if auto-continue is enabled
if [ "$auto_continue" = true ]; then
printf "\nAuto-continue is enabled. Skipping user prompt and retrying...\n"
select_version # automatically continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
select_version # automatically continue
select_version # Automatically continue.

while true; do
if [ "$auto_continue" = true ]; then
# If auto-continue is enabled, proceed without prompt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If auto-continue is enabled, proceed without prompt
# If auto-continue is enabled, proceed without prompt.

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

Successfully merging this pull request may close these issues.

Enhance build script with argument support for OS, version, and auto-continue
3 participants