mirror of
https://github.com/taigrr/go-selfupdate
synced 2025-01-18 04:33:12 -08:00
Merge pull request #10 from Luzifer/dircheck
Added a check for file is directory
This commit is contained in:
commit
93817829dd
7
main.go
7
main.go
@ -164,6 +164,12 @@ func main() {
|
|||||||
createBuildDir()
|
createBuildDir()
|
||||||
|
|
||||||
// If dir is given create update for each file
|
// If dir is given create update for each file
|
||||||
|
fi, err := os.Stat(appPath)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if fi.IsDir() {
|
||||||
files, err := ioutil.ReadDir(appPath)
|
files, err := ioutil.ReadDir(appPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
@ -171,6 +177,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createUpdate(appPath, platform)
|
createUpdate(appPath, platform)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user