本文整理汇总了Golang中github.com/prasmussen/glot-code-runner/cmd.RunStdin函数的典型用法代码示例。如果您正苦于以下问题:Golang RunStdin函数的具体用法?Golang RunStdin怎么用?Golang RunStdin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RunStdin函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
fname := filepath.Base(files[0])
stdout, stderr, err := cmd.Run(workDir, "kotlinc", fname)
if err != nil {
return stdout, stderr, err
}
return cmd.RunStdin(workDir, stdin, "kotlin", className(fname))
}
示例2: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
args := append([]string{"scalac"}, files...)
stdout, stderr, err := cmd.Run(workDir, args...)
if err != nil {
return stdout, stderr, err
}
return cmd.RunStdin(workDir, stdin, "scala", "Main")
}
示例3: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
binName := "a.out"
stdout, stderr, err := cmd.Run(workDir, "idris", "-o", binName, files[0])
if err != nil {
return stdout, stderr, err
}
binPath := filepath.Join(workDir, binName)
return cmd.RunStdin(workDir, stdin, binPath)
}
示例4: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
binName := "a.out"
sourceFiles := util.FilterByExtension(files, "cpp")
args := append([]string{"clang++", "-std=c++11", "-o", binName}, sourceFiles...)
stdout, stderr, err := cmd.Run(workDir, args...)
if err != nil {
return stdout, stderr, err
}
binPath := filepath.Join(workDir, binName)
return cmd.RunStdin(workDir, stdin, binPath)
}
示例5: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
binName := "a.exe"
sourceFiles := reverse(util.FilterByExtension(files, "fs"))
args := append([]string{"fsharpc", "--out:" + binName}, sourceFiles...)
stdout, stderr, err := cmd.Run(workDir, args...)
if err != nil {
return stdout, stderr, err
}
binPath := filepath.Join(workDir, binName)
return cmd.RunStdin(workDir, stdin, "mono", binPath)
}
示例6: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
// Compile all files except the first
for _, file := range files[1:] {
stdout, stderr, err := cmd.Run(workDir, "erlc", file)
if err != nil {
return stdout, stderr, err
}
}
// Run first file with escript
return cmd.RunStdin(workDir, stdin, "escript", files[0])
}
示例7: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
jsName := "a.js"
// Find all typescript files and build compile command
sourceFiles := util.FilterByExtension(files, "ts")
args := append([]string{"tsc", "-out", jsName}, sourceFiles...)
// Compile to javascript
stdout, stderr, err := cmd.Run(workDir, args...)
if err != nil {
return stdout, stderr, err
}
return cmd.RunStdin(workDir, stdin, "node", jsName)
}
示例8: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
// Move bootstrap files into work dir
stdout, stderr, err := cmd.RunBash(workDir, "cp -rf /bootstrap/* .")
if err != nil {
return stdout, stderr, err
}
// Compile elm to javascript
stdout, stderr, err = cmd.Run(workDir, "elm-make", files[0], "--output", "elm.js")
if err != nil {
return stdout, stderr, err
}
// Run javascript with node via app.js from bootstrap
return cmd.RunStdin(workDir, stdin, "node", "app.js")
}
示例9: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
objName := "a.o"
binName := "a.out"
stdout, stderr, err := cmd.Run(workDir, "nasm", "-f", "elf64", "-o", objName, files[0])
if err != nil {
return stdout, stderr, err
}
stdout, stderr, err = cmd.Run(workDir, "ld", "-o", binName, objName)
if err != nil {
return stdout, stderr, err
}
binPath := filepath.Join(workDir, binName)
return cmd.RunStdin(workDir, stdin, binPath)
}
示例10: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
sourceFiles := util.FilterByExtension(files, "ex")
args := append([]string{"elixirc"}, sourceFiles...)
return cmd.RunStdin(workDir, stdin, args...)
}
示例11: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
return cmd.RunStdin(workDir, stdin, "ruby", files[0])
}
示例12: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
return cmd.RunStdin(workDir, stdin, "nim", "--hints:off", "--verbosity:0", "compile", "--run", files[0])
}
示例13: Run
func Run(files []string, stdin string) (string, string, error) {
workDir := filepath.Dir(files[0])
return cmd.RunStdin(workDir, stdin, "java", "-cp", "/usr/share/java/clojure.jar", "clojure.main", files[0])
}