Skip to content

Commit

Permalink
make.fsx: implement the 'reinstall' target in Win
Browse files Browse the repository at this point in the history
For easier development experience.

TODO: implement same in Linux, but maybe when we get rid of
legacy framework support, so that we can just adopt make.fsx
(instead of having install.sh for mac/linux like it's
happening now).
  • Loading branch information
knocte committed Aug 18, 2023
1 parent 190356d commit f018791
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ release:
install: release
./scripts/install.sh

reinstall:
echo "'reinstall' target not supported yet in Unix, uninstall manually and use 'install' for now" >> /dev/stderr
exit 1

check:
./scripts/runTests.fsx
35 changes: 21 additions & 14 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,17 @@ let finalReleaseFolderPath = Path.Combine(releaseFolderPath, "net6.0")
let finalReleaseFolderPath = releaseFolderPath
#endif

match maybeTarget with

| None
| Some "all" -> MakeAll() |> ignore

| Some "release" ->
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

| Some "install" ->
let Install (isReinstall: bool) =
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

if fsxInstallationDir.Exists then
// TODO
failwithf
"Existing installation found in '%s'. This script can't overwrite an existing installation yet"
fsxInstallationDir.FullName
if not isReinstall then
failwithf
"Existing installation found in '%s'. Consider using the target 'reinstall' instead of 'install'."
fsxInstallationDir.FullName
else
fsxInstallationDir.Delete true

Console.WriteLine "Installing..."
Console.WriteLine()
Expand Down Expand Up @@ -321,6 +314,20 @@ match maybeTarget with
Console.WriteLine(
sprintf "Successfully installed in %s" fsxInstallationDir.FullName
)
match maybeTarget with

| None
| Some "all" -> MakeAll() |> ignore

| Some "release" ->
let buildConfig = BinaryConfig.Release
JustBuild buildConfig

| Some "reinstall" ->
Install true

| Some "install" ->
Install false

| Some "check" ->

Expand Down

0 comments on commit f018791

Please sign in to comment.