fix: In-place unarchive

pull/3756/head
Laurynas Gadliauskas 2021-05-31 15:09:48 +03:00
parent a4b607d5a0
commit 641b3c45ed
3 changed files with 4 additions and 3 deletions

View File

@ -94,6 +94,6 @@ help:
@sed -n 's/^## //p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /' | sort
.PHONY: build-release-bin
build-release-bin:
build-release-bin: build-frontend
GO111MODULE=on GOOS=linux GOARCH=amd64 $(GO) build -ldflags '$(LDFLAGS)' -o bin/filebrowser-$(VERSION)
tar -C bin -czf "dist/filebrowser-$(VERSION).tar.gz" "filebrowser-$(VERSION)"

View File

@ -110,7 +110,7 @@ func (l byModified) Less(i, j int) bool {
}
func (l *Listing) FilterItems(fn func(fi *FileInfo) bool) {
var filtered []*FileInfo
filtered := []*FileInfo{}
for _, item := range l.Items {
if fn(item) {
filtered = append(filtered, item)

View File

@ -229,7 +229,8 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
override := r.URL.Query().Get("override") == "true"
rename := r.URL.Query().Get("rename") == "true"
if !override && !rename {
unarchive := r.URL.Query().Get("action") == "unarchive"
if !override && !rename && !unarchive {
if _, err = d.user.Fs.Stat(dst); err == nil {
return http.StatusConflict, nil
}