Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jekyll-hardlinks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sutty
jekyll
jekyll-hardlinks
Commits
61ef3942
Commit
61ef3942
authored
4 years ago
by
fauno
Browse files
Options
Downloads
Patches
Plain Diff
remove files from previous builds
parent
2066dacb
Branches
antifascista
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/jekyll/static_file.rb
+15
-1
15 additions, 1 deletion
lib/jekyll/static_file.rb
with
15 additions
and
1 deletion
lib/jekyll/static_file.rb
+
15
−
1
View file @
61ef3942
...
...
@@ -6,12 +6,26 @@ module Jekyll
# the file
def
write
(
dest
)
dest_path
=
destination
(
dest
)
return
if
File
.
exist?
dest_path
# If the file exists but it's not a hardlink, we remove it and
# replace it with one. This is useful when migrating from a site
# already built without this plugin.
if
File
.
exist?
dest_path
return
if
hardlink?
dest_path
FileUtils
.
rm
dest_path
end
self
.
class
.
mtimes
[
path
]
=
mtime
FileUtils
.
mkdir_p
(
File
.
dirname
(
dest_path
))
FileUtils
.
ln
(
path
,
dest_path
)
end
private
# Verifies the path has hardlinks
def
hardlink?
(
path
)
File
.
stat
(
path
).
nlink
>
1
end
end
end
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