Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Properly handle semantic versioning in initialize_gradle_project #27

@michaelin

Description

@michaelin

The initialize_gradle_project function in utils.sh fails when the current Gradle version is a patch version (x.y.z):

vscode ➜ /workspaces/gradle-katas/build-phases (master ✗) $ ./setup.sh 
[KATA] Setting up the kata
[KATA] ------
[KATA] 
[KATA] Cleaning up old exercise
[KATA] Initializing new exercise
(standard_in) 1: syntax error
[KATA] Done!
vscode ➜ /workspaces/gradle-katas/build-phases (master ✗) $ gradle --version | grep Gradle | awk '{print $2}'
6.8.1

The problem is that bc can't compare semver version numbers. Consider using another tool or truncating the version before comparison.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions