1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00
Files
kubo/plugin/plugins/gen_main.sh
2019-05-21 11:09:57 -07:00

23 lines
434 B
Bash
Executable File

#!/usr/bin/env bash
dir=${1:?first paramater with dir to work in is required}
pkg=${2:?second parameter with full name of the package is required}
main_pkg="$dir/main"
shortpkg="uniquepkgname"
mkdir -p "$main_pkg"
cat > "$main_pkg/main.go" <<EOL
package main
import (
$shortpkg "$pkg"
)
var Plugins = $shortpkg.Plugins //nolint
func main() {
panic("this is a plugin, build it as a plugin, this is here as for go#20312")
}
EOL