Skip to content

Commit

Permalink
Merge pull request #52 from nqminhuit/truncate-file-gis-one-line
Browse files Browse the repository at this point in the history
Improve gis st --one-line
  • Loading branch information
nqminhuit authored Oct 10, 2022
2 parents 2bf8a67 + 8276809 commit 88febed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.nqm</groupId>
<artifactId>gis</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>${packaging}</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/nqm/Gis.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name = "gis",
description = "Git extension wrapper which supports submodules",
mixinStandardHelpOptions = true,
version = "1.1.0")
version = "1.1.1")
public class Gis extends GitCommand {

@Option(names = "-v", description = "Show more details information.", scope = ScopeType.INHERIT)
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/nqm/utils/StdOutUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static java.lang.System.err; // NOSONAR
import static java.lang.System.out; // NOSONAR
import static java.util.function.Predicate.not;
import java.nio.file.Path;
import java.util.Optional;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -110,7 +111,10 @@ public static String gitStatusOneLine(String line) {
default -> Optional.of(lineSplit)
.map(StdOutUtils::preProcessUntrackFile)
.map(splitS -> " "
+ Optional.of(splitS[splitS.length - 1]).map(getFiles(line)).orElse(""))
+ Optional.of(splitS[splitS.length - 1])
.map(getFiles(line))
.map(l -> Path.of(l).getFileName().toString())
.orElse(""))
.orElse("");
};
}
Expand Down

0 comments on commit 88febed

Please sign in to comment.