Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
fix: part 1 of NIO bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
msfjarvis committed Jun 17, 2024
1 parent 315a6b1 commit 2c35189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import app.passwordstore.ui.crypto.BasePGPActivity
import app.passwordstore.ui.main.LaunchActivity
import java.nio.file.Path
import kotlin.io.path.absolutePathString
import kotlin.io.path.name
import kotlin.io.path.nameWithoutExtension
import kotlin.io.path.pathString
import kotlin.io.path.relativeTo
Expand All @@ -24,7 +25,7 @@ data class PasswordItem(

val name = file.nameWithoutExtension

val fullPathToParent = file.relativeTo(rootDir).parent.pathString
val fullPathToParent = file.absolutePathString().replace(rootDir.absolutePathString(), "").replace(file.name, "")

val longName =
BasePGPActivity.getLongName(fullPathToParent, rootDir.absolutePathString(), toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ open class BasePGPActivity : AppCompatActivity() {
*/
fun getPGPIdentifiers(subDir: String): List<PGPIdentifier>? {
val repoRoot = PasswordRepository.getRepositoryDirectory()
// This should ideally be `repoRoot.resolve(subDir)` but for some reason doing that returns `/subDir` as the path
// which doesn't work inside `findTillRoot`, so we're doing this manual dance.
val gpgIdentifierFile =
repoRoot.resolve(subDir).findTillRoot(".gpg-id", repoRoot)
Paths.get(repoRoot.absolutePathString(), subDir).findTillRoot(".gpg-id", repoRoot)
?: repoRoot.resolve(".gpg-id").createFile()
val gpgIdentifiers =
gpgIdentifierFile
Expand Down

0 comments on commit 2c35189

Please sign in to comment.