summarylogtreecommitdiffstats
path: root/flutter.install
blob: 5c896b72f6a675f38b48c372dc034402d2519940 (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
28
29
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"
}

post_install() {
  mv "/opt/flutter/.git-refs" "/opt/flutter/.git"
}