diff options
| author | ruki <[email protected]> | 2023-03-03 00:54:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-03 00:54:18 +0800 |
| commit | b14cb76831863973a09ce7d1bc00e9aba0beec7b (patch) | |
| tree | ab01122dd6a1b25cb1b2d3978439d6f7072ff130 /scripts | |
| parent | e4f1765e6a7b6365bc03912630353e96964f3719 (diff) | |
improve get.sh
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/get.sh | 37 |
1 files changed, 3 insertions, 34 deletions
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 |
