BCDevOps / bcdk

BC Developer Kit
Apache License 2.0
6 stars 15 forks source link

Release/0.0.1 #15

Closed ActionAnalytics closed 5 years ago

ActionAnalytics commented 5 years ago

Just starting to automate the readme.md a bit.

Next steps would be to detect the OS, install the correct package manager (brew, choco, apt, yum, rpm), and have the correct package manager in a variable.

https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script

case "$OSTYPE" in solaris) echo "SOLARIS" ;; darwin) echo "OSX" ;; linux) echo "LINUX" ;; bsd) echo "BSD" ;; msys) echo "WINDOWS" ;; ) echo "unknown: $OSTYPE" ;; esac

Detect the platform (similar to $OSTYPE)

OS="uname" case $OS in 'Linux') OS='Linux' alias ls='ls --color=auto' ;; 'FreeBSD') OS='FreeBSD' alias ls='ls -G' ;; 'WindowsNT') OS='Windows' ;; 'Darwin') OS='Mac' ;; 'SunOS') OS='Solaris' ;; 'AIX') ;; *) ;; esac