summarylogtreecommitdiffstats
path: root/flutter.install
blob: aec6a93a2c545e671cea70f2a13cc348753d70bd (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
pre_upgrade() {
  NEW=$1
  OLD=$2

  if [[ "$OLD" == "3.7"* || "$OLD" == "3.6"* ]]; then
    echo "Cleaning up previous flutter installation."
    rm -rf "/opt/flutter"
  fi

  rm -rf "/opt/flutter/.git"
}

post_upgrade() {
  NEW=$1
  OLD=$2

  if [[ "$OLD" == "3.7"* || "$OLD" == "3.6"* ]]; then
    if grep -q "flutterusers" /etc/group; then
      echo "Removing group flutterusers as no longer needed."
      groupdel "flutterusers"
    fi
  fi

  mv "/opt/flutter/.git-refs" "/opt/flutter/.git"
}