This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
app/src/main/java/app/passwordstore Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import app.passwordstore.ui.crypto.BasePGPActivity
1111import app.passwordstore.ui.main.LaunchActivity
1212import java.nio.file.Path
1313import kotlin.io.path.absolutePathString
14+ import kotlin.io.path.name
1415import kotlin.io.path.nameWithoutExtension
1516import kotlin.io.path.pathString
1617import kotlin.io.path.relativeTo
@@ -24,7 +25,7 @@ data class PasswordItem(
2425
2526 val name = file.nameWithoutExtension
2627
27- val fullPathToParent = file.relativeTo( rootDir).parent.pathString
28+ val fullPathToParent = file.absolutePathString().replace( rootDir.absolutePathString(), " " ).replace(file.name, " " )
2829
2930 val longName =
3031 BasePGPActivity .getLongName(fullPathToParent, rootDir.absolutePathString(), toString())
Original file line number Diff line number Diff line change @@ -161,8 +161,10 @@ open class BasePGPActivity : AppCompatActivity() {
161161 */
162162 fun getPGPIdentifiers (subDir : String ): List <PGPIdentifier >? {
163163 val repoRoot = PasswordRepository .getRepositoryDirectory()
164+ // This should ideally be `repoRoot.resolve(subDir)` but for some reason doing that returns `/subDir` as the path
165+ // which doesn't work inside `findTillRoot`, so we're doing this manual dance.
164166 val gpgIdentifierFile =
165- repoRoot.resolve( subDir).findTillRoot(" .gpg-id" , repoRoot)
167+ Paths .get( repoRoot.absolutePathString(), subDir).findTillRoot(" .gpg-id" , repoRoot)
166168 ? : repoRoot.resolve(" .gpg-id" ).createFile()
167169 val gpgIdentifiers =
168170 gpgIdentifierFile
You can’t perform that action at this time.
0 commit comments