~mna/snow unlisted

snow/scripts/cleanup.sh -rwxr-xr-x 506 bytes
424066c5Martin Angers doc: v0.0.5 9 months ago
                                                                                
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
#!/usr/bin/env bash

set -euo pipefail

function run {
  local pwd=""; pwd=$(pwd)
  if [[ ${pwd} != *snow ]]; then
    echo "must be run from the root of the repository"
    exit 1
  fi

  # cleanup the bin directory
  local dir="bin"
  if [[ "$(ls -A $dir)" ]]; then
    rm $dir/*
  fi
  # cleanup codegen test failures
  dir="pkg/codegen/testdata"
  if [[ "$(ls -A $dir/**/*.go 2>/dev/null)" ]]; then
    rm $dir/**/*.go 
  fi
  if [[ "$(ls -A $dir/*/ 2>/dev/null)" ]]; then
    rmdir $dir/*
  fi
}

run