#FIXME: nodejs @swc currently only support amd64 and arm64
abinfo "Moving prebuilt OpenList-Frontend files to OpenList..."
cp -rv "$SRCDIR"/../{assets,images,static,streamer,index.html} "$SRCDIR"/public/dist

abinfo "Generating Go linker flags (GO_LDFLAGS) for embedded version information..."
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
version=$(git describe --long --tags --dirty --always)
webVersion=$PKGVER
GO_LDFLAGS=(
        "-w -s"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.BuiltAt=$builtAt'"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GoVersion=$goVersion'"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GitAuthor=$gitAuthor'"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GitCommit=$gitCommit'"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.Version=$version'"
        "-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.WebVersion=$webVersion'"
)
