Fix: Package list file detection
This commit is contained in:
parent
29c4f92625
commit
0f182fb17f
@ -40,9 +40,12 @@ object SourceUtils {
|
||||
builder.append(":${url.port}")
|
||||
}
|
||||
|
||||
if (url.path != null && url.path.isNotEmpty()) {
|
||||
val path = url.path
|
||||
if (path != null && path.isNotEmpty()) {
|
||||
builder.append("_")
|
||||
builder.append(url.path.substring(1)) // Skip '/'
|
||||
val fixedPath = path.replace("/", "_")
|
||||
.substring(1) // skip the last '/'
|
||||
builder.append(fixedPath)
|
||||
}
|
||||
builder.append("_dists_stable_main_binary-")
|
||||
return builder.toString()
|
||||
|
@ -3,6 +3,8 @@ package io.neoterm
|
||||
import io.neoterm.component.pm.PackageComponent
|
||||
import io.neoterm.component.pm.SourceUtils
|
||||
import io.neoterm.frontend.component.ComponentManager
|
||||
import junit.framework.Assert.assertEquals
|
||||
import junit.framework.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
|
||||
@ -28,4 +30,9 @@ class PackageManagerTest {
|
||||
|
||||
System.err.println(pm.packages["rcs"]?.description)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testReplaceAll() {
|
||||
assertEquals("/root/boom.sh".replace("/", "_"), "_root_boom.sh")
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user