Add go_deps function to get dependnecies from go.mod
This commit is contained in:
parent
22172d3522
commit
4b8e83a60e
@ -20,6 +20,13 @@ make_scripts() (
|
||||
done
|
||||
)
|
||||
|
||||
go_deps() (
|
||||
GO_MOD=${1:-go.mod}
|
||||
START_AT=$(grep -n '^require ($' "${GO_MOD}" | awk -F : '{print $1}' | head -n 1)
|
||||
END_AT=$(grep -n '^)$' "${GO_MOD}" | awk -F : '{print $1}' | head -n 1)
|
||||
awk 'NR>'"${START_AT}"' && NR<'"${END_AT}"' {print $1}' "${GO_MOD}"
|
||||
)
|
||||
|
||||
make_script() (
|
||||
cat <<-EOF > "${1}"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
Loading…
Reference in New Issue
Block a user