Documentation ¶
Index ¶
- Variables
- func BashExec(cmd string) (string, error)
- func CreateDir(path string) error
- func CreateFile(path string) error
- func DirExists(path string) bool
- func ExecuteCommand(cmd *exec.Cmd) string
- func ExitWithError(msg interface{})
- func FileExists(path string) bool
- func GetKeysFromMapString(m map[string]string) (keys []string)
- func GetKeysFromMapStringInterface(m map[string]interface{}) (keys []string)
- func GetPHPStormExecutable() (string, error)
- func GetPlatform() string
- func OpenURLInDefaultBrowser(url string) error
- func PrintError(msg interface{})
- func ValidateURL(path string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var EditorLaunchCommands = map[string]string{
"vim": "vim",
"nvim": "nvim",
"emacs": "emacs",
"vscode": "code --wait",
"atom": "atom --wait",
"sublime": "subl -n -w",
"phpstorm": "phpstorm --wait",
"pstorm": "pstorm --wait",
}
EditorLaunchCommands are the commands used to open a file in a specified text editor and wait for the file to be saved to close
Functions ¶
func ExecuteCommand ¶
ExecuteCommand runs an external shell command
func ExitWithError ¶
func ExitWithError(msg interface{})
ExitWithError prints a clear error and exits the program
func GetKeysFromMapString ¶
GetKeysFromMapString returns the values of a map[string]string keys as a slice of strings
func GetKeysFromMapStringInterface ¶
GetKeysFromMapStringInterface parses keys from a map[string]interface
func GetPHPStormExecutable ¶
GetPHPStormExecutable checks for which phpstorm executable is set in their PATH to determine the launch command to use
func GetPlatform ¶
func GetPlatform() string
GetPlatform returns the OS platform of the current machine
func OpenURLInDefaultBrowser ¶
OpenURLInDefaultBrowser launches the user system's default browser with a given URL as the target
func PrintError ¶
func PrintError(msg interface{})
PrintError outputs a standard error message to the user's console
func ValidateURL ¶
ValidateURL accepts a path and validates it as a url
Types ¶
This section is empty.