JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

provide a `get shell` like oh my posh #65

Closed trajano closed 8 months ago

trajano commented 8 months ago

Code of Conduct

What would you like to see changed/added?

Since I think I'll be using aliae to bootstrap oh-my-posh it would be nice to have the same get shell capability

So I can change my bootstrap.sh from

if (! command -v aliae &> /dev/null )
then
  mkdir -p $HOME/.local/bin
  curl -s https://aliae.dev/install.sh | bash -s -- -d $HOME/.local/bin
  export PATH=$HOME/.local/bin:$PATH
fi
if [ -e $HOME/OneDrive/gist/aliae.yml ]
then
  ALIAE_CONFIG="$HOME/OneDrive/gist/aliae.yml"
else
  ALIAE_CONFIG="https://gist.githubusercontent.com/trajano/315fecc2986b5ac5f642d207d79303f8/raw/5b6a905fd426c70d84cbba5713978ddd2a9a9b37/aliae.yml"
fi
if [ "$ZSH_VERSION" ]
  then
    eval "$( aliae init zsh -c $ALIAE_CONFIG )"
elif [ "$BASH_VERSION" ]
then
  eval "$( aliae init bash -c $ALIAE_CONFIG )"
elif [ "$FISH_VERSION" ]
then
  aliae init fish -c $ALIAE_CONFIG | source
fi

to

if (! command -v aliae &> /dev/null )
then
  mkdir -p $HOME/.local/bin
  curl -s https://aliae.dev/install.sh | bash -s -- -d $HOME/.local/bin
  export PATH=$HOME/.local/bin:$PATH
fi
if [ -e $HOME/OneDrive/gist/aliae.yml ]
then
  ALIAE_CONFIG="$HOME/OneDrive/gist/aliae.yml"
else
  ALIAE_CONFIG="https://gist.githubusercontent.com/trajano/315fecc2986b5ac5f642d207d79303f8/raw/5b6a905fd426c70d84cbba5713978ddd2a9a9b37/aliae.yml"
fi
if [ "$ZSH_VERSION" || $BASH_VERSION" ]
  then
    eval "$( aliae init $(aliae get shell )-c $ALIAE_CONFIG )"
elif [ "$FISH_VERSION" ]
then
  aliae init fish -c $ALIAE_CONFIG | source 
fi

Though something that would generate the actual command for multiple shells would be better since this can only apply to zsh and bash (which are the two I primarily use)