Skip to content

Commit

Permalink
Fix 'should_reload' mechanic
Browse files Browse the repository at this point in the history
  • Loading branch information
malmaud committed Mar 23, 2016
1 parent b85ccfb commit e39e019
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
*.ipynb
test.jl
.tags*
13 changes: 7 additions & 6 deletions src/Autoreload.jl
Expand Up @@ -51,15 +51,16 @@ function arequire(filename=""; command= :on, depends_on=UTF8String[])
filename = find_file(standarize(filename), constants=options[:constants])
filename == nothing && error("File $original_filename not found")
if command in [:on, :on_depends]
was_reloading = false
if filename in keys(files)
was_reloading = files[filename].should_reload
remove_file(filename)
end
# if command == :on
# should_reload = true
# else
# should_reload = false
# end
should_reload = true
if command == :on
should_reload = true
else
should_reload = was_reloading
end
files[filename] = AFile(should_reload, reload_mtime(filename), UTF8String[])
parsed_file = parse_file(filename)
auto_depends = extract_deps(parsed_file)
Expand Down

0 comments on commit e39e019

Please sign in to comment.