If no argument is provided default to .
This commit is contained in:
@@ -9,7 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func Restart(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
if err := os.Chdir(dir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func Shell(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
|
||||
name := getServerName(dir)
|
||||
|
||||
@@ -20,7 +23,10 @@ func Shell(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
|
||||
func Say(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
|
||||
name := getServerName(dir)
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ import (
|
||||
)
|
||||
|
||||
func Start(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
|
||||
if err := os.Chdir(dir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func Status(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
|
||||
name := getServerName(dir)
|
||||
|
||||
|
||||
@@ -9,7 +9,11 @@ import (
|
||||
)
|
||||
|
||||
func Stop(cmd *cobra.Command, args []string) {
|
||||
dir := args[0]
|
||||
dir := "."
|
||||
if len(args) > 0 {
|
||||
dir = args[0]
|
||||
}
|
||||
|
||||
if err := os.Chdir(dir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user