Add M1 platform support

This commit is contained in:
Jonny Barnes 2021-07-17 18:24:07 +01:00
parent 6bc31a2a4a
commit 971b9730d4
2 changed files with 12 additions and 5 deletions

View file

@ -14,8 +14,10 @@ alias gb="git rev-parse --abbrev-ref HEAD"
alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'"
test $PLATFORM = 'linux' && alias ls="ls -F --color=always"
test $PLATFORM = 'osx' && alias ls="ls -FG"
test $PLATFORM = 'osx-m1' && alias ls="ls -FG"
test $PLATFORM = 'linux' && alias pipup="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U"
test $PLATFORM = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U"
test $PLATFORM = 'osx-m1' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U"
alias rtor="tmux attach -t rtor"
alias startace="acestreamengine --client-console --upload-limit 0 --download-limit 0"
alias up="sudo pacman -Syu"

View file

@ -1,7 +1,12 @@
export PLATFORM="unkown"
unamestr=$(uname -s)
if [[ "$unamestr" == 'Linux' ]]; then
osname=$(uname -s)
cputpye=£(uname -m)
if [[ "$osname" == 'Linux' ]]; then
export PLATFORM="linux"
elif [[ "$unamestr" == 'Darwin' ]]; then
elif [[ "$osname" == 'Darwin' ]]; then
if [[ "$cputpye" == 'x86_64' ]]; then
export PLATFORM="osx"
elif [[ "$cputype" == 'arm64' ]]; then
export PLATFORM="osx-m1"
fi
fi