summaryrefslogtreecommitdiff
path: root/scripts/get.sh
diff options
context:
space:
mode:
authorruki <[email protected]>2023-05-06 23:43:08 +0800
committerruki <[email protected]>2023-05-06 23:43:08 +0800
commit45829dab6f83494b1101fd5da3771cdca2400aad (patch)
treef579fb1dab7c97fd23dd50e4d4c2a283e08ac48d /scripts/get.sh
parentb391073c181286e41b3767dea16433cffca57619 (diff)
switch to new profile
Diffstat (limited to 'scripts/get.sh')
-rwxr-xr-xscripts/get.sh51
1 files changed, 2 insertions, 49 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index 319b8b2c7..05450aa3a 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -240,58 +240,11 @@ fi
#-----------------------------------------------------------------------------
# install profile
#
-install_profile_new() {
+install_profile() {
export XMAKE_ROOTDIR="$prefix/bin"
export PATH="$XMAKE_ROOTDIR:$PATH"
xmake --version
xmake update --integrate
}
-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_old() {
- 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
-
- if xmake --version >/dev/null 2>&1; then xmake --version; else
- source ~/.xmake/profile
- xmake --version
- echo "Reload shell profile by running the following command now!"
- echo -e "\x1b[1msource ~/.xmake/profile\x1b[0m"
- fi
-}
-if test_eq "$branch" "__local__"; then
- install_profile_new
-elif test_eq "$branch" "dev"; then
- install_profile_new
-elif test_eq "$branch" "master"; then
- install_profile_new
-else
- install_profile_old
-fi
-
+install_profile