1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-15 11:56:15 +08:00
Files
kubo/plugin/plugins/gen_main.sh
Łukasz Magiera e8f05e7334 Fix freebsd build issues
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-03 23:46:44 +02:00

23 lines
425 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
func main() {
panic("this is a plugin, build it as a plugin, this is here as for go#20312")
}
EOL