diff options
| author | TitanSnow <[email protected]> | 2017-05-25 07:44:04 +0800 |
|---|---|---|
| committer | TitanSnow <[email protected]> | 2017-05-25 07:44:04 +0800 |
| commit | 7ee82c2b09ee0af9289c2aad852707bd7d2e637b (patch) | |
| tree | c215e232e2ba8f92d449b62b204b52b3e6682c61 /scripts | |
| parent | a00ed183e738749f8c5068a3fe56dab54b4fb961 (diff) | |
fix chaos installation
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/get.sh | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/scripts/get.sh b/scripts/get.sh index e780b34cf..f4c605bdc 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -98,29 +98,42 @@ then my_exit 'Build Fail' $rv fi fi -PATHclone=$PATH -patharr=($PATHclone) -prefix= -for st in "${patharr[@]}" -do - if [[ "$st" = "$HOME"* ]] - then - cwd=$PWD - mkdir -p "$st" - cd "$st" || continue - echo $$ > $$xmake_getter_test 2>/dev/null || continue - rm $$xmake_getter_test 2>/dev/null || continue - cd .. || continue - mkdir -p share 2>/dev/null || continue - prefix=$(pwd) - cd "$cwd" || my_exit 'Chdir Error' - break - fi -done +# PATHclone=$PATH +# patharr=($PATHclone) +if [ "$prefix" = "" ] +then + prefix=~/.local +fi +# for st in "${patharr[@]}" +# do +# if [[ "$st" = "$HOME"* ]] +# then +# cwd=$PWD +# mkdir -p "$st" +# cd "$st" || continue +# echo $$ > $$xmake_getter_test 2>/dev/null || continue +# rm $$xmake_getter_test 2>/dev/null || continue +# cd .. || continue +# mkdir -p share 2>/dev/null || continue +# prefix=$(pwd) +# cd "$cwd" || my_exit 'Chdir Error' +# break +# fi +# done if [ "x$prefix" != x ] then make -C /tmp/$$xmake_getter --no-print-directory install prefix="$prefix"|| my_exit 'Install Fail' else $sudoprefix make -C /tmp/$$xmake_getter --no-print-directory install || my_exit 'Install Fail' fi -xmake --version +shell_profile(){ + if [[ "$SHELL" = */zsh ]]; then echo ~/.zshrc + elif [[ "$SHELL" = */ksh ]]; then echo ~/.kshrc + else echo ~/.bash_profile; fi +} +xmake --version >/dev/null 2>&1 && xmake --version || { + echo "export PATH=$prefix/bin:\$PATH" >> $(shell_profile) + export PATH=$prefix/bin:$PATH + xmake --version + echo -e "Reload shell profile by running \x1b[1msource '$(shell_profile)'\x1b[0m now!" +} |
