Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
d1991c9e
Commit
d1991c9e
authored
Aug 26, 2014
by
Peter van 't Hof
Browse files
Fix bug on spaced files name
parent
564dfea2
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Ln.scala
View file @
d1991c9e
...
...
@@ -71,9 +71,9 @@ class Ln(val root: Configurable) extends InProcessFunction with Configurable {
if
(
relative
)
{
// workaround until we have `ln` that works with relative path (i.e. `ln -r`)
"ln -s "
+
inRelative
+
"
"
+
outCanonical
"ln -s
'
"
+
inRelative
+
"
' '
"
+
outCanonical
+
"'"
}
else
{
"ln -s "
+
inCanonical
+
"
"
+
outCanonical
"ln -s
'
"
+
inCanonical
+
"
' '
"
+
outCanonical
+
"'"
}
}
...
...
biopet-framework/src/test/scala/nl/lumc/sasc/biopet/extensions/LnUnitTest.scala
View file @
d1991c9e
...
...
@@ -18,7 +18,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/dir/nested/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Target is one level above link, relative set to true"
)
...
...
@@ -27,7 +27,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/dir/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s ../target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
../target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Target is two levels above link, relative set to true"
)
...
...
@@ -36,7 +36,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s ../../target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
../../target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Target is a child of a directory one level above link, relative set to true"
)
...
...
@@ -45,7 +45,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/dir/another_nested/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s ../another_nested/target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
../another_nested/target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Target is one level below link, relative set to true"
)
...
...
@@ -54,7 +54,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/dir/nested/deeper/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s deeper/target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
deeper/target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Target is two levels below link, relative set to true"
)
...
...
@@ -63,7 +63,7 @@ class LnUnitTest {
ln
.
relative
=
true
ln
.
in
=
new
File
(
"/dir/nested/even/deeper/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s even/deeper/target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
even/deeper/target.txt
' '
/dir/nested/link.txt
'
"
)
}
@Test
(
description
=
"Relative set to false"
)
...
...
@@ -72,7 +72,7 @@ class LnUnitTest {
ln
.
relative
=
false
ln
.
in
=
new
File
(
"/dir/nested/target.txt"
)
ln
.
out
=
new
File
(
"/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s /dir/nested/target.txt
/dir/nested/link.txt"
)
Assert
.
assertEquals
(
ln
.
cmd
,
"ln -s
'
/dir/nested/target.txt
' '
/dir/nested/link.txt
'
"
)
}
// TODO: test for case where abosolute is true and input paths are relative?
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment