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

Add more interactive install-home command #186

Merged
merged 7 commits into from
Oct 12, 2021

Conversation

lwronski
Copy link
Contributor

@lwronski lwronski commented Oct 5, 2021

  1. If scala-cli is up-to-date, we abort installation.
  2. If scala-cli is out-of-date, we automatically update scala-cli
  3. If someone want to downgrade to scala-cli, we ask user to confirm this operation.
  4. If someone put --force flag, we install scala-cli without any checking, if scala-cli is up-to-date.

@lwronski lwronski force-pushed the feature/install-home branch 3 times, most recently from 8338428 to 5e416a8 Compare October 5, 2021 14:29
@lwronski lwronski force-pushed the feature/install-home branch 2 times, most recently from 8bffcd4 to 3c6e447 Compare October 6, 2021 10:11
System.err.println("Abort")
sys.exit(1)
}
else
Copy link
Contributor

Choose a reason for hiding this comment

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

we could handle incorrect response here and ask again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to make something similar to apt installer. There, if you don't accept operating with passing 'Y', it will abort process and you have to run again.

Downgrade to scala-cli should be very rarely situation and we should help user to avoid this operation. So I think, that passing any other sign then 'Y' should reject this operation.

Copy link
Contributor

@tpasternak tpasternak left a comment

Choose a reason for hiding this comment

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

I'd only change the chmod parameter to u+x or sth like this. The two other comments may be ignored.

System.err.println(
s"Error: scala-cli is already installed $oldVersion and up-to-date. Downgrade to $newVersion pass -f or --force."
)
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer not to put exit in a function named logDowngrade. Minor issue, can be done in a follow-up PR

)
}

def runInstallHome(): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very sophisticated test, took me some time that we build fake scala-cli executables that can print only version and juggle them. Maybe we could comment it (in at all)

@romanowski romanowski merged commit d22aa44 into VirtusLab:master Oct 12, 2021
@lwronski lwronski deleted the feature/install-home branch October 26, 2021 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants