fix: use correct flag positional argument
This commit is contained in:
committed by
Michael Hobbs
parent
72eb8a06f0
commit
25759bcbb4
@@ -13,9 +13,9 @@ import (
|
|||||||
// computes the ports for a given app container
|
// computes the ports for a given app container
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(2)
|
procType := flag.Arg(1)
|
||||||
isHerokuishContainer := common.ToBool(flag.Arg(3))
|
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
||||||
|
|
||||||
if procType != "web" {
|
if procType != "web" {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
// write the ipaddress to stdout for a given app container
|
// write the ipaddress to stdout for a given app container
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(2)
|
procType := flag.Arg(1)
|
||||||
isHerokuishContainer := common.ToBool(flag.Arg(3))
|
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
||||||
containerId := flag.Arg(4)
|
containerId := flag.Arg(3)
|
||||||
|
|
||||||
ipAddress := network.GetContainerIpaddress(appName, procType, isHerokuishContainer, containerId)
|
ipAddress := network.GetContainerIpaddress(appName, procType, isHerokuishContainer, containerId)
|
||||||
fmt.Fprintln(os.Stdout, ipAddress)
|
fmt.Fprintln(os.Stdout, ipAddress)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
// returns the listeners (host:port combinations) for a given app container
|
// returns the listeners (host:port combinations) for a given app container
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
|
|
||||||
dokkuRoot := common.MustGetEnv("DOKKU_ROOT")
|
dokkuRoot := common.MustGetEnv("DOKKU_ROOT")
|
||||||
appRoot := strings.Join([]string{dokkuRoot, appName}, "/")
|
appRoot := strings.Join([]string{dokkuRoot, appName}, "/")
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
// write the port to stdout for a given app container
|
// write the port to stdout for a given app container
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(2)
|
procType := flag.Arg(1)
|
||||||
isHerokuishContainer := common.ToBool(flag.Arg(3))
|
isHerokuishContainer := common.ToBool(flag.Arg(2))
|
||||||
containerId := flag.Arg(4)
|
containerId := flag.Arg(3)
|
||||||
|
|
||||||
port := network.GetContainerPort(appName, procType, isHerokuishContainer, containerId)
|
port := network.GetContainerPort(appName, procType, isHerokuishContainer, containerId)
|
||||||
fmt.Fprintln(os.Stdout, port)
|
fmt.Fprintln(os.Stdout, port)
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
// writes the ip to disk
|
// writes the ip to disk
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(2)
|
procType := flag.Arg(1)
|
||||||
containerIndex := flag.Arg(3)
|
containerIndex := flag.Arg(2)
|
||||||
ip := flag.Arg(4)
|
ip := flag.Arg(3)
|
||||||
|
|
||||||
if appName == "" {
|
if appName == "" {
|
||||||
common.LogFail("Please specify an app to run the command on")
|
common.LogFail("Please specify an app to run the command on")
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
// writes the port to disk
|
// writes the port to disk
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
appName := flag.Arg(1)
|
appName := flag.Arg(0)
|
||||||
procType := flag.Arg(2)
|
procType := flag.Arg(1)
|
||||||
containerIndex := flag.Arg(3)
|
containerIndex := flag.Arg(2)
|
||||||
port := flag.Arg(4)
|
port := flag.Arg(3)
|
||||||
|
|
||||||
if appName == "" {
|
if appName == "" {
|
||||||
common.LogFail("Please specify an app to run the command on")
|
common.LogFail("Please specify an app to run the command on")
|
||||||
|
|||||||
Reference in New Issue
Block a user