File: generate

package info (click to toggle)
golang-github-willabides-kongplete 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: sh: 40; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

CDPATH="" cd -- "$(dirname -- "$0")/.."

if [ "$1" = "--check" ]; then
  [ -z "$(git status --porcelain)" ] || {
    git status
    echo 1>&2 "Running 'script/generate --check' requires a clean git working tree. Please commit or stash changes and try again."
    exit 1
  }
  script/generate
  [ -z "$(git status --porcelain)" ] || {
    git status
    echo 1>&2 "script/generate resulted in changes. Please commit changes (or 'git reset --hard HEAD' if you aren't ready to commit changes)."
    git diff
    exit 1
  }
  exit 0
fi

go generate ./...