Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Configuration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Application
Configuration
Commits
b83d77aa
Verified
Commit
b83d77aa
authored
2 years ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix deleted files must not be removed from the watch list
parent
3bd7d419
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
import.go
+2
-8
2 additions, 8 deletions
import.go
watch.go
+4
-4
4 additions, 4 deletions
watch.go
with
6 additions
and
12 deletions
import.go
+
2
−
8
View file @
b83d77aa
...
...
@@ -94,11 +94,7 @@ func (s *Settings[C]) importFiles() {
s
.
fileWatch
.
Lock
()
// new files may have been added
tmpWatchList
:=
make
(
map
[
string
]
bool
)
defer
func
()
{
s
.
fileWatch
.
watchList
=
tmpWatchList
s
.
fileWatch
.
Unlock
()
}()
...
...
@@ -122,9 +118,6 @@ func (s *Settings[C]) importFiles() {
r
:=
(
io
.
Reader
)(
f
)
s
.
importStream
(
reader
{
s
.
files
.
format
,
r
})
f
.
Close
()
tmpWatchList
[
fn
]
=
true
}
for
_
,
f
:=
range
s
.
files
.
files
{
...
...
@@ -135,10 +128,11 @@ func (s *Settings[C]) importFiles() {
r
.
Close
()
continue
}
s
.
importStream
(
reader
{
f
.
format
,
r
})
r
.
Close
()
tmpWatchList
[
f
.
path
]
=
true
}
}
...
...
This diff is collapsed.
Click to expand it.
watch.go
+
4
−
4
View file @
b83d77aa
...
...
@@ -98,18 +98,18 @@ func (s *Settings[C]) Watch() *Settings[C] {
}
// add all files to the watch list
for
file
:=
range
s
.
fileWatch
.
watchList
{
for
file
Path
:=
range
s
.
fileWatch
.
watchList
{
fileInfo
,
err
:=
os
.
Stat
(
file
)
fileInfo
,
err
:=
os
.
Stat
(
file
Path
)
if
err
!=
nil
{
s
.
errors
=
append
(
s
.
errors
,
err
)
continue
}
if
fileInfo
.
IsDir
()
{
err
=
s
.
fileWatch
.
watcher
.
Add
(
file
)
err
=
s
.
fileWatch
.
watcher
.
Add
(
file
Path
)
}
else
{
err
=
s
.
fileWatch
.
watcher
.
Add
(
path
.
Dir
(
file
))
err
=
s
.
fileWatch
.
watcher
.
Add
(
path
.
Dir
(
file
Path
))
}
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment