summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/browser/fathom/test-setup.sh
blob: 1547c4a395d275c1a27bf28759e805afaabcde4f (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
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# This script download samples for testing

clean=1
cleanall=0
sample_dir=autofill-repo-samples

while [ $# -gt 0 ]; do
    case "$1" in
      -c) clean=1 ;;
      -cc) cleanall=1 ;;
    esac
    shift
done

# Check out source code
if ! [ -d "fathom-form-autofill" ]; then
  echo "Get samples from repo..."
  git clone https://github.com/mozilla-services/fathom-form-autofill
fi

if ! [ -d "samples" ]; then
  echo "Copy samples..."
  mkdir $sample_dir
  cp -r fathom-form-autofill/samples/testing $sample_dir
  cp -r fathom-form-autofill/samples/training $sample_dir
  cp -r fathom-form-autofill/samples/validation $sample_dir
else
  echo "\`samples\` directory already exists"
fi

if [ "$clean" = 1 ] || [ "$cleanall" = 1 ]; then
  echo "Cleanup..."
  rm -rf fathom-form-autofill
fi

if [ "$cleanall" = 1 ]; then
  rm -rf $sample_dir
fi