mirror of
https://github.com/holos-run/holos.git
synced 2026-03-19 00:37:45 +00:00
Previously `go install` fails to install holos. ``` ❯ go install github.com/holos-run/holos/cmd/holos@latest ../../go/pkg/mod/github.com/holos-run/holos@v0.86.0/internal/frontend/frontend.go:25:12: pattern holos/dist/holos/ui/index.html: no matching files found ../../go/pkg/mod/github.com/holos-run/holos@v0.86.0/doc/website/website.go:14:12: pattern all:build: no matching files found ``` This is because we do not commit required files. This patch fixes the problem by following Rob Pike's guidance to commit generated files. This patch also replaces the previous use of Makefile tasks to generate code with //go:generate directives. This means the process of keeping the source code clean is straight forward: ``` git clone make tools make generate make build ``` Refer to https://go.dev/blog/generate > Also, if the containing package is intended for import by go get, once > the file is generated (and tested!) it must be checked into the source > code repository to be available to clients. - Rob Pike
12 lines
240 B
Bash
Executable File
12 lines
240 B
Bash
Executable File
#! /bin/bash
|
|
#
|
|
# Expected to be called by go:generate in the service directory
|
|
|
|
set -euo pipefail
|
|
|
|
nodebin="$(cd ../internal/frontend/holos/node_modules/.bin && pwd)"
|
|
export PATH="${nodebin}:${PATH}"
|
|
|
|
buf dep update
|
|
(cd .. && buf generate)
|