From b14cb76831863973a09ce7d1bc00e9aba0beec7b Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 3 Mar 2023 00:54:18 +0800 Subject: improve get.sh --- scripts/get.sh | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'scripts') diff --git a/scripts/get.sh b/scripts/get.sh index b5c79caf8..1350e3470 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -240,40 +240,9 @@ fi #----------------------------------------------------------------------------- # install profile # - -write_profile() { - grep -sq ".xmake/profile" $1 || echo -e "\n# >>> xmake >>>\n[[ -s \"\$HOME/.xmake/profile\" ]] && source \"\$HOME/.xmake/profile\" # load xmake profile\n# <<< xmake <<<" >> $1 -} - -install_profile() { - if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=\"$prefix/bin\"" > ~/.xmake/profile - echo 'export PATH="$XMAKE_ROOTDIR:$PATH"' >> ~/.xmake/profile - if [ -f "$projectdir/scripts/register-completions.sh" ]; then - cat "$projectdir/scripts/register-completions.sh" >> ~/.xmake/profile - else - remote_get_content "$gitrepo_raw/scripts/register-completions.sh" >> ~/.xmake/profile - fi - - if [ -f "$projectdir/scripts/register-virtualenvs.sh" ]; then - cat "$projectdir/scripts/register-virtualenvs.sh" >> ~/.xmake/profile - else - remote_get_content "$gitrepo_raw/scripts/register-virtualenvs.sh" >> ~/.xmake/profile - fi - - if [[ "$SHELL" = */zsh ]]; then - write_profile ~/.zshrc - elif [[ "$SHELL" = */ksh ]]; then - write_profile ~/.kshrc - elif [[ "$SHELL" = */bash ]]; then - write_profile ~/.bashrc - if [ "$(uname)" == "Darwin" ]; then - write_profile ~/.bash_profile - fi - else write_profile ~/.profile - fi -} -install_profile +export XMAKE_ROOTDIR="$prefix/bin" +export PATH="$XMAKE_ROOTDIR:$PATH" +xmake update --integrate if xmake --version >/dev/null 2>&1; then xmake --version; else source ~/.xmake/profile xmake --version -- cgit v1.3.1