feat: ensure related go source and vscode plugins are installed in devcontainer

This commit is contained in:
Jose Diaz-Gonzalez committed 2021-11-12 16:41:52 -05:00
1 parent bb54231233
commit 02b3b8e7e6
5 files changed
+42 -4

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -x
main() {
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do
if [[ ! -f "plugins/$plugin/go.mod" ]]; then
continue
fi
pushd "plugins/$plugin" >/dev/null || return 1
echo "====> Cloning all modules $plugin"
go list -m -f '{{define "M"}}git clone https://{{.Path}}.git /root/go/src/{{.Path}} || true && echo {{.Version}}{{end}}{{if not .Main}}{{if not .Replace}}{{template "M" .}}{{end}}{{end}}' all >tmp-file
bash tmp-file
rm tmp-file
go list -m -f '{{define "M"}}git clone https://{{.Path}}.git /usr/local/go/src/{{.Path}} || true && echo {{.Version}}{{end}}{{if not .Main}}{{if not .Replace}}{{template "M" .}}{{end}}{{end}}' all >tmp-file
bash tmp-file
rm tmp-file
popd >/dev/null || return 1
done
}
main "$@"