diff --git a/README.md b/README.md index 51ef53b..f167ecc 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,5 @@ chmod +x bml.sh ``` ## Bugs -- :) +- Throws error and exists on MacOS and WSL \ + Solution run: `rm osdetect.sh` diff --git a/bml.sh b/bml.sh index 8db0eb5..2ed02ee 100755 --- a/bml.sh +++ b/bml.sh @@ -23,4 +23,5 @@ lightgreen=`tput setaf 10` yellow=`tput setaf 11` reset=`tput sgr0` +source osdetect.sh 2>/dev/null source readpass.sh diff --git a/osdetect.sh b/osdetect.sh new file mode 100644 index 0000000..9a31097 --- /dev/null +++ b/osdetect.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ "uname -r | grep -oE microsoft" = "microsoft" ] + then + echo "${red}WSL Not Supported!${reset}" 1>&2 + exit +elif [ "uname -a | grep -oE Darwin | tail -n1" = "Darwin" ] + then + echo "${red}MacOS Not Supported!${reset}" 1>&2 + exit +else + : +fi + +source readpass.sh