Skip to content

Instantly share code, notes, and snippets.

@UlisseMini
Created January 27, 2019 17:08
Show Gist options
  • Save UlisseMini/9f9b0ae3d7370cf92e0b9dc88c51f2ff to your computer and use it in GitHub Desktop.
Save UlisseMini/9f9b0ae3d7370cf92e0b9dc88c51f2ff to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("npm", "start")
// Make the commands file descriptors go to the console
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Stdin = os.Stdin
// Run the command
if err := cmd.Run(); err != nil {
fmt.Println(err)
}
// Wait for the user to press enter before closing the command prompt.
fmt.Print("[Press enter]")
fmt.Scanln()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment