mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 01:17:37 +03:00
fix: fix the calculation of the justpath
property in the File class
The `justpath` property in the File class was previously returning an incorrect value. The calculation was splitting the `path` string by '/' and then selecting a range of elements to join together. The range was specified as `slice(1, -2)`, which resulted in excluding the first element and including the second-to-last element. The fix updates the range to `slice(0, -1)`, which includes all elements except for the last one. This ensures that the `justpath` property correctly represents the path without the filename.
This commit is contained in:
parent
080773be9f
commit
45dae4197d
@ -33,7 +33,7 @@ export class File {
|
||||
}
|
||||
|
||||
get justpath() {
|
||||
return this.path.split('/').slice(1, -2).join('/');
|
||||
return this.path.split('/').slice(0, -1).join('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user