Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
871cc6f1
Commit
871cc6f1
authored
Dec 26, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
call flush after files rm
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
fd4c4122
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
core/commands/files/files.go
core/commands/files/files.go
+14
-0
No files found.
core/commands/files/files.go
View file @
871cc6f1
...
@@ -659,6 +659,17 @@ remove files or directories
...
@@ -659,6 +659,17 @@ remove files or directories
dashr
,
_
,
_
:=
req
.
Option
(
"r"
)
.
Bool
()
dashr
,
_
,
_
:=
req
.
Option
(
"r"
)
.
Bool
()
var
success
bool
defer
func
()
{
if
success
{
err
:=
pdir
.
Flush
()
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
}
}()
// if '-r' specified, don't check file type (in bad scenarios, the block may not exist)
// if '-r' specified, don't check file type (in bad scenarios, the block may not exist)
if
dashr
{
if
dashr
{
err
:=
pdir
.
Unlink
(
name
)
err
:=
pdir
.
Unlink
(
name
)
...
@@ -667,6 +678,7 @@ remove files or directories
...
@@ -667,6 +678,7 @@ remove files or directories
return
return
}
}
success
=
true
return
return
}
}
...
@@ -686,6 +698,8 @@ remove files or directories
...
@@ -686,6 +698,8 @@ remove files or directories
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
return
}
}
success
=
true
}
}
},
},
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment