mirror of
https://github.com/SangeloDev/niminit.git
synced 2024-11-22 16:32:40 +00:00
Suppressable warnings with '-s' & install warning
This commit is contained in:
parent
8def96f832
commit
bb05fd53bf
2 changed files with 22 additions and 8 deletions
11
install.sh
11
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
|
||||
|
||||
|
|
19
niminit.nim
19
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
|
||||
|
|
Loading…
Reference in a new issue