Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wenovus committed Nov 10, 2023
1 parent e050d6e commit 45017fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cmd_gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ options=(
--trim_module_prefix=openconfig
--exclude_modules=ietf-interfaces
--split_package_paths="/network-instances/network-instance/protocols/protocol/isis=netinstisis,/network-instances/network-instance/protocols/protocol/bgp=netinstbgp"
--paths={{ .ModelRoot }},{{ .RepoRoot }}/third_party/ietf
--paths={{ .ModelRoot }}/...,{{ .RepoRoot }}/third_party/ietf/...
--annotations
)
script_options=(
)
function run-dir() {
declare prefix="$workdir"/"$1"=="$2"==
outdir=$GOPATH/src/"$1"."$2"/
outdir=$GOPATH/src/"$1"."$2"
mkdir "$outdir"
local options=( --output_dir="${outdir}"/oc --base_package_path="$1"."$2"/oc "${options[@]}" )
shift 2
Expand All @@ -237,6 +237,7 @@ function run-dir() {
if [[ $status -eq "0" ]]; then
go mod init &>> ${prefix}pass || status=1
go mod tidy &>> ${prefix}pass || status=1
goimports -w . &>> ${prefix}pass || status=1
go build ./... &>> ${prefix}pass || status=1
fi
if [[ $status -eq "1" ]]; then
Expand Down
5 changes: 3 additions & 2 deletions cmd_gen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ options=(
--trim_module_prefix=openconfig
--exclude_modules=ietf-interfaces
--split_package_paths="/network-instances/network-instance/protocols/protocol/isis=netinstisis,/network-instances/network-instance/protocols/protocol/bgp=netinstbgp"
--paths=testdata,/workspace/third_party/ietf
--paths=testdata/...,/workspace/third_party/ietf/...
--annotations
)
script_options=(
)
function run-dir() {
declare prefix="$workdir"/"$1"=="$2"==
outdir=$GOPATH/src/"$1"."$2"/
outdir=$GOPATH/src/"$1"."$2"
mkdir "$outdir"
local options=( --output_dir="${outdir}"/oc --base_package_path="$1"."$2"/oc "${options[@]}" )
shift 2
Expand All @@ -207,6 +207,7 @@ function run-dir() {
if [[ $status -eq "0" ]]; then
go mod init &>> ${prefix}pass || status=1
go mod tidy &>> ${prefix}pass || status=1
goimports -w . &>> ${prefix}pass || status=1
go build ./... &>> ${prefix}pass || status=1
fi
if [[ $status -eq "1" ]]; then
Expand Down

0 comments on commit 45017fc

Please sign in to comment.