summarylogtreecommitdiffstats
path: root/flutter.install
blob: 3d518b98016e10b42881123758ecf60b0cbb2129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)If you intend to use it as a 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)You need to source $(tput setaf 2)/etc/profile$(tput setaf 4) or relogin to add flutter to your path.$(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"
}

post_upgrade() {
  post_install
}

post_remove() {
  groupdel flutterusers
  printf "$(tput setaf 4)If you had added/modified files or permissions in folder /opt/flutter is possible you need to delete it manually.$(tput sgr0)\n"
  printf "$(tput setaf 2)rm -rf /opt/flutter$(tput sgr0)\n"
}