From a21ec09a71f0e4c60957b37eb61e33f1a4ae6e86 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 19:57:35 +0800 Subject: improve virtualenv on linux --- scripts/get.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/get.sh') diff --git a/scripts/get.sh b/scripts/get.sh index 8363b4499..21814e45e 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,13 +227,19 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export PATH=$prefix/bin:\$PATH" > ~/.xmake/profile + echo "export XMAKE_ROOTDIR=$prefix/bin" > ~/.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 -- cgit v1.3.1 From e273de15d253d4dc1b904e4fa0da5fb1bbe57304 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 21:11:47 +0800 Subject: move PATH setting to toplevel --- scripts/get.sh | 3 ++- scripts/register-completions.sh | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts/get.sh') diff --git a/scripts/get.sh b/scripts/get.sh index 21814e45e..060ee4e20 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,7 +227,8 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=$prefix/bin" > ~/.xmake/profile + 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 diff --git a/scripts/register-completions.sh b/scripts/register-completions.sh index c93cfb15e..e274605b2 100755 --- a/scripts/register-completions.sh +++ b/scripts/register-completions.sh @@ -1,8 +1,6 @@ # parameter completions for *nix shell -export PATH=${XMAKE_ROOTDIR}:$PATH - if [[ "$SHELL" = */zsh ]]; then # zsh parameter completion for xmake _xmake_zsh_complete() -- cgit v1.3.1 From 34241bb3d8a1dec0ead81316473e505eb2e5f713 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 23:14:16 +0800 Subject: fix xmake not found issue --- scripts/get.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/get.sh') diff --git a/scripts/get.sh b/scripts/get.sh index 060ee4e20..76d329116 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,8 +227,8 @@ write_profile() 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 + echo "export XMAKE_ROOTDIR=\"$prefix/bin\"\n" > ~/.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 -- cgit v1.3.1 From 65cd1d83d3f61415607b8976e7b5c215b67e42a8 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 24 Aug 2021 23:46:40 +0800 Subject: fix typo --- scripts/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/get.sh') diff --git a/scripts/get.sh b/scripts/get.sh index 76d329116..f64ff8041 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -227,7 +227,7 @@ write_profile() install_profile() { if [ ! -d ~/.xmake ]; then mkdir ~/.xmake; fi - echo "export XMAKE_ROOTDIR=\"$prefix/bin\"\n" > ~/.xmake/profile + 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 -- cgit v1.3.1