Bump github.com/gookit/config/v2 from 2.1.8 to 2.2.2
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.1.8 to 2.2.2. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.1.8...v2.2.2) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
Ralf Haferkamp
parent
03045c5ccc
commit
5ebc596352
+26
-3
@@ -3,7 +3,7 @@ package sysutil
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// Workdir get
|
||||
@@ -14,11 +14,34 @@ func Workdir() string {
|
||||
|
||||
// BinDir get
|
||||
func BinDir() string {
|
||||
binFile := os.Args[0]
|
||||
return path.Dir(binFile)
|
||||
return filepath.Dir(os.Args[0])
|
||||
}
|
||||
|
||||
// BinName get
|
||||
func BinName() string {
|
||||
return filepath.Base(os.Args[0])
|
||||
}
|
||||
|
||||
// BinFile get
|
||||
func BinFile() string {
|
||||
return os.Args[0]
|
||||
}
|
||||
|
||||
// Open file or url address
|
||||
func Open(fileOrURL string) error {
|
||||
return OpenURL(fileOrURL)
|
||||
}
|
||||
|
||||
// OpenBrowser file or url address
|
||||
func OpenBrowser(fileOrURL string) error {
|
||||
return OpenURL(fileOrURL)
|
||||
}
|
||||
|
||||
// OpenFile opens new browser window for the file path.
|
||||
func OpenFile(path string) error {
|
||||
fpath, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return OpenURL("file://" + fpath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user