diff options
| author | Shulhan <ms@kilabit.info> | 2018-05-27 17:40:33 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-05-27 17:40:33 +0700 |
| commit | 5d0596c69943380932328ccb690cfe5f948bede4 (patch) | |
| tree | 5a06e6d1c53760d1bb040cff4d649c27b44b74ab | |
| parent | 22975b16c0971dff152f66083110093f2c07a602 (diff) | |
| download | beku-5d0596c69943380932328ccb690cfe5f948bede4.tar.xz | |
install: check for non empty directory
| -rw-r--r-- | env.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -819,6 +819,14 @@ func (env *Env) String() string { // install a package. // func (env *Env) install(pkg *Package) (ok bool, err error) { + if !IsDirEmpty(pkg.FullPath) { + fmt.Printf(">>> Directory %s is not empty.\n", pkg.FullPath) + ok = confirm(os.Stdin, msgContinue, false) + if !ok { + return + } + } + err = pkg.Install() if err != nil { _ = pkg.Remove() |
