This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree 2 files changed +5
-2
lines changed
app/src/main/java/app/passwordstore
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
11
11
import app.passwordstore.ui.main.LaunchActivity
12
12
import java.nio.file.Path
13
13
import kotlin.io.path.absolutePathString
14
+ import kotlin.io.path.name
14
15
import kotlin.io.path.nameWithoutExtension
15
16
import kotlin.io.path.pathString
16
17
import kotlin.io.path.relativeTo
@@ -24,7 +25,7 @@ data class PasswordItem(
24
25
25
26
val name = file.nameWithoutExtension
26
27
27
- val fullPathToParent = file.relativeTo( rootDir).parent.pathString
28
+ val fullPathToParent = file.absolutePathString().replace( rootDir.absolutePathString(), " " ).replace(file.name, " " )
28
29
29
30
val longName =
30
31
BasePGPActivity .getLongName(fullPathToParent, rootDir.absolutePathString(), toString())
Original file line number Diff line number Diff line change @@ -161,8 +161,10 @@ open class BasePGPActivity : AppCompatActivity() {
161
161
*/
162
162
fun getPGPIdentifiers (subDir : String ): List <PGPIdentifier >? {
163
163
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.
164
166
val gpgIdentifierFile =
165
- repoRoot.resolve( subDir).findTillRoot(" .gpg-id" , repoRoot)
167
+ Paths .get( repoRoot.absolutePathString(), subDir).findTillRoot(" .gpg-id" , repoRoot)
166
168
? : repoRoot.resolve(" .gpg-id" ).createFile()
167
169
val gpgIdentifiers =
168
170
gpgIdentifierFile
You can’t perform that action at this time.
0 commit comments