Adds a `datastore` core plugin that serves every official datastore under one command, with the datastore type as the first argument, as in `dokku datastore:create postgres lollipop`. It is built on the dokku-datastore sdk, and leaves a datastore to its official plugin while that plugin is enabled.
22 lines
329 B
Go
22 lines
329 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/dokku/dokku-datastore/sdk"
|
|
)
|
|
|
|
// main entrypoint to all subcommands
|
|
func main() {
|
|
parts := strings.Split(os.Args[0], "/")
|
|
subcommand := parts[len(parts)-1]
|
|
|
|
args := []string{}
|
|
if len(os.Args) > 2 {
|
|
args = os.Args[2:]
|
|
}
|
|
|
|
os.Exit(sdk.RunSubcommand(subcommand, args))
|
|
}
|