diff options
author | Fredy García | 2022-09-21 19:27:56 -0500 |
---|---|---|
committer | Fredy García | 2022-09-21 19:27:56 -0500 |
commit | ea25cb6ff789713e53de65dabfb3bdffd3b82d21 (patch) | |
tree | a4467dda9e4f058890ac526177a09aecb87741e5 /flutter.install | |
parent | 8686fdaaedbb1edd1406fc4df079208ae710d148 (diff) | |
download | aur-ea25cb6ff789713e53de65dabfb3bdffd3b82d21.tar.gz |
Using tput only when supported.
Diffstat (limited to 'flutter.install')
-rw-r--r-- | flutter.install | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/flutter.install b/flutter.install index 656de0ea1969..6f7c7f3d18d5 100644 --- a/flutter.install +++ b/flutter.install @@ -2,16 +2,31 @@ post_install() { groupadd -f flutterusers chgrp -R flutterusers /opt/flutter chmod -R g+w /opt/flutter - printf "$(tput setaf 4)Flutter was installed on $(tput setaf 2)/opt/flutter$(tput sgr0)\n" - printf "$(tput setaf 4)$(tput sgr0)\n" - printf "$(tput setaf 4)In case you encounter problems using Flutter as regular user, add your user into the group flutterusers:$(tput sgr0)\n" - printf "$(tput setaf 2)gpasswd -a \${USER} flutterusers$(tput sgr0)\n" - printf "$(tput setaf 4)$(tput sgr0)\n" - printf "$(tput setaf 4)Re-login your terminal in to the group flutterusers:$(tput sgr0)\n" - printf "$(tput setaf 2)newgrp flutterusers$(tput sgr0)\n" - printf "$(tput setaf 4)$(tput sgr0)\n" - printf "$(tput setaf 4)Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):$(tput sgr0)\n" - printf "$(tput setaf 2)flutter doctor$(tput sgr0)\n" + tput setaf 0 2>/dev/null + if [[ "$?" == "0" ]]; then + tput sgr0 + printf "$(tput setaf 4)Flutter was installed on $(tput setaf 2)/opt/flutter$(tput sgr0)\n" + printf "$(tput setaf 4)$(tput sgr0)\n" + printf "$(tput setaf 4)In case you encounter problems using Flutter as regular user, add your user into the group flutterusers:$(tput sgr0)\n" + printf "$(tput setaf 2)gpasswd -a \${USER} flutterusers$(tput sgr0)\n" + printf "$(tput setaf 4)$(tput sgr0)\n" + printf "$(tput setaf 4)Re-login your terminal in to the group flutterusers:$(tput sgr0)\n" + printf "$(tput setaf 2)newgrp flutterusers$(tput sgr0)\n" + printf "$(tput setaf 4)$(tput sgr0)\n" + printf "$(tput setaf 4)Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):$(tput sgr0)\n" + printf "$(tput setaf 2)flutter doctor$(tput sgr0)\n" + else + printf "Flutter was installed on /opt/flutter\n" + printf "\n" + printf "In case you encounter problems using Flutter as regular user, add your user into the group flutterusers:\n" + printf "gpasswd -a \${USER} flutterusers\n" + printf "\n" + printf "Re-login your terminal in to the group flutterusers:\n" + printf "newgrp flutterusers\n" + printf "\n" + printf "Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):\n" + printf "flutter doctor\n" + fi } post_upgrade() { |