From bb05fd53bf693576777fac555371b38bab0efa7d Mon Sep 17 00:00:00 2001 From: Sangelo Date: Mon, 6 Mar 2023 21:57:32 +0100 Subject: [PATCH] Suppressable warnings with '-s' & install warning --- install.sh | 11 +++++++++++ niminit.nim | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 5249f5f..5f8ee99 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,17 @@ # (c) Sangelo, 2023 # Read LICENSE for more info +# Check for macOS +if [[ $OSTYPE == 'darwin'* ]]; then + read -p "Warning: MacOS is currently untested. If there's any issues, please report them on GitHub.\n Are you sure you want to continue? [y/N] " macOSChoice + case + [yY][eE][sS]|[yY]|[zZ]|[jJ]) + echo "Continuing with experimental support..." + *) + echo "Exiting..." + exit 0 +fi + # Compile program nim c -o:bin/niminit niminit diff --git a/niminit.nim b/niminit.nim index 9687c26..ebd8e89 100644 --- a/niminit.nim +++ b/niminit.nim @@ -6,14 +6,17 @@ when defined(windows): echo "Warning: Windows is currently unsupported!" quit 1 when defined(macosx): - echo "Warning: macOS is currently untested. Would you like to continue? [y/N]" - var input = stdin.readLine() - case input.toLower - of "yes", "y", "z", "j": - echo "Initialising non-empty directory..." - else: - echo "Cancelling..." - quit 0 + if "-s" in (commandLineParams()): + echo "Suppressing experimental support warning" + else: + echo "Warning: macOS is currently untested. Would you like to continue? [y/N]" + var input = stdin.readLine() + case input.toLower + of "yes", "y", "z", "j": + echo "Initialising non-empty directory..." + else: + echo "Cancelling..." + quit 0 # Check for files in directory var count = 0