Skip to content

Commit

Permalink
configure.{sh,fsx}: improve 1st time .NET run UX
Browse files Browse the repository at this point in the history
1. Skip dotnet (Core) welcome message, otherwise it might be
confusing to see it pop up when calling our configure script.

2. First time `dotnet fsi` is run, it takes a while to start
(at least 20 or 30seconds on my VirtualBox VM running
Ubuntu22.04.3) so it's better if that time is spent after
printing ellipsis (...) so that it is more clear that one
needs to wait.
  • Loading branch information
knocte committed Feb 2, 2024
1 parent b9ef32e commit cde7798
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUNNER_ARG=invalid
REPL_CHECK_MSG="checking for a working F# REPL..."

if which dotnet >/dev/null 2>&1; then
echo "$REPL_CHECK_MSG" $'found'
echo -n "$REPL_CHECK_MSG"
RUNNER_BIN=dotnet
RUNNER_ARG=fsi
else
Expand Down Expand Up @@ -35,7 +35,7 @@ else
echo "$0" $'failed, please install "dotnet" first'
exit 1
else
echo "$FSX_CHECK_MSG" $'found'
echo -n "$FSX_CHECK_MSG"
RUNNER_BIN=fsx
RUNNER_ARG=
fi
Expand All @@ -53,11 +53,11 @@ else
cd scripts/fsx && ./configure.sh --prefix=$BIN_DIR && make install && cd ../..
RUNNER_BIN="$BIN_DIR/bin/fsx"
else
echo "$FSX_CHECK_MSG" $'found'
echo -n "$FSX_CHECK_MSG"
RUNNER_BIN=fsx
fi
else
echo "$REPL_CHECK_MSG" $'found'
echo -n "$REPL_CHECK_MSG"
RUNNER_BIN=fsharpi
RUNNER_ARG="--define:LEGACY_FRAMEWORK"
fi
Expand All @@ -73,4 +73,4 @@ if [ ! -z "${RUNNER_ARG}" ]; then
echo -e "FsxRunnerArg=$RUNNER_ARG" >> scripts/build.config
fi
source scripts/build.config
$RUNNER_BIN $RUNNER_ARG ./scripts/configure.fsx "$@"
DOTNET_NOLOGO=true $RUNNER_BIN $RUNNER_ARG ./scripts/configure.fsx "$@"
2 changes: 2 additions & 0 deletions scripts/configure.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ open Fsdk
open Fsdk.Process


Console.WriteLine " found"

let rootDir = DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, ".."))

let initialConfigFile, buildTool =
Expand Down

0 comments on commit cde7798

Please sign in to comment.