Created
January 27, 2019 17:08
-
-
Save UlisseMini/9f9b0ae3d7370cf92e0b9dc88c51f2ff to your computer and use it in GitHub Desktop.
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
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