Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
9f1260e3
Commit
9f1260e3
authored
Feb 17, 2009
by
Cyril Rohr
Browse files
Modified generator so that it doesn't write a hard link if it already exists
parent
04e3cf52
Changes
1
Hide whitespace changes
Inline
Side-by-side
generators/lib/g5k_generator.rb
View file @
9f1260e3
...
...
@@ -121,10 +121,10 @@ class ReferenceGenerator
groups
.
has_key?
(
G5K
::
Link
)
and
groups
[
G5K
::
Link
].
each
do
|
link
|
from
=
File
.
join
(
repository
,
"
#{
link
.
from
}
.json"
)
to
=
File
.
join
(
repository
,
link
.
path
)
# Hard link
s
w
il
l always be regenerated
# TODO: find a way to detect if a
link
has
to be
regenerated
puts
"Hard link to be written =
\t
#{
to
}
->
#{
from
}
"
FileUtils
.
link
(
from
,
to
,
:force
=>
true
)
unless
options
[
:simulate
]
unles
s
F
il
e
.
exists?
(
to
)
puts
"Hard
link to be
written =
\t
#{
to
}
->
#{
from
}
"
FileUtils
.
link
(
from
,
to
,
:force
=>
true
)
unless
options
[
:simulate
]
end
end
end
...
...
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