Skip to content

Commit

Permalink
Merge pull request #102 from hashicorp/r-codegenerate-by-patterns
Browse files Browse the repository at this point in the history
codegen: find structs file by patterns
  • Loading branch information
Preetha authored May 9, 2019
2 parents f9859e4 + de34bca commit 934840d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions nomad/structs/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

# ensure that ent and pro structs don't get auto generated without tags
FILES="$(ls ./*.go | grep -v -e _test.go -e .generated.go -e _ent.go -e _pro.go -e _ent_ -e _pro_ | tr '\n' ' ')"
codecgen -d 100 -o structs.generated.go ${FILES}
2 changes: 1 addition & 1 deletion nomad/structs/structs_codegen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package structs

//go:generate codecgen -d 100 -o structs.generated.go diff.go errors.go network.go node.go operator.go streaming_rpc.go structs.go
//go:generate ./generate.sh

0 comments on commit 934840d

Please sign in to comment.