-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # src/app/project_runner.go # src/tui/proc-info-form.go # src/types/validators.go
- Loading branch information
Showing
14 changed files
with
153 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ type Commander interface { | |
StderrPipe() (io.ReadCloser, error) | ||
Stop(int, bool) error | ||
SetCmdArgs() | ||
AttachIo() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"github.com/f1bonacc1/process-compose/src/api" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// runCmd represents the up command | ||
var runCmd = &cobra.Command{ | ||
Use: "run PROCESS [flags] -- [process_args]", | ||
Short: "Run PROCESS in the foreground, and its dependencies in the background", | ||
Long: `Run selected process with std(in|out|err) attached, while other processes run in the background. | ||
Command line arguments, provided after --, are passed to the PROCESS.`, | ||
Args: cobra.MinimumNArgs(1), | ||
// Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
*pcFlags.Headless = false | ||
|
||
processName := args[0] | ||
|
||
if len(args) > 1 { | ||
argsLenAtDash := cmd.ArgsLenAtDash() | ||
if argsLenAtDash != 1 { | ||
message := "Extra positional arguments provided! To pass args to PROCESS, separate them from process-compose arguments with: --" | ||
fmt.Println(message) | ||
os.Exit(1) | ||
} | ||
args = args[argsLenAtDash:] | ||
} else { | ||
// Clease args as they will contain the processName | ||
args = []string{} | ||
} | ||
|
||
runner := getProjectRunner( | ||
[]string{processName}, | ||
*pcFlags.NoDependencies, | ||
processName, | ||
args, | ||
) | ||
|
||
api.StartHttpServer(false, *pcFlags.PortNum, runner) | ||
runProject(runner) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(runCmd) | ||
|
||
runCmd.Flags().BoolVarP(pcFlags.NoDependencies, "no-deps", "", *pcFlags.NoDependencies, "don't start dependent processes") | ||
runCmd.Flags().AddFlag(rootCmd.Flags().Lookup("config")) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.