Skip to content

Commit

Permalink
added logo to version
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Mar 8, 2021
1 parent c858c24 commit 3ef5c89
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions core/src/main/java/com/redislabs/riot/RiotApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,35 @@ protected void registerConverters(CommandLine commandLine) {
*/
static class ManifestVersionProvider implements IVersionProvider {

public String[] getVersion() throws Exception {
Enumeration<URL> resources = getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
URL url = resources.nextElement();
try {
@Override
public String[] getVersion() {
return new String[]{
// @formatter:off
"",
" β–€ β–„ @|fg(4;1;1) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|@",
" β–ˆ β–ˆβ–ˆ β–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ @|fg(4;2;1) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|@",
" β–ˆβ–ˆ β–ˆ β–ˆ β–ˆ β–ˆ @|fg(5;4;1) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|@",
" β–ˆ β–ˆ β–ˆ β–ˆ β–ˆ @|fg(1;4;1) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|@",
" β–ˆ β–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆ @|fg(0;3;4) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|@"+ " v" + getVersionString(),
""};
// @formatter:on
}

private String getVersionString() {
try {
Enumeration<URL> resources = getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
URL url = resources.nextElement();
Manifest manifest = new Manifest(url.openStream());
if (isApplicableManifest(manifest)) {
Attributes attr = manifest.getMainAttributes();
return new String[]{get(attr, "Implementation-Title") + " version \"" + get(attr, "Implementation-Version") + "\""};
return String.valueOf(get(attr, "Implementation-Version"));
}
} catch (IOException ex) {
return new String[]{"Unable to read from " + url + ": " + ex};
}
} catch (IOException ex) {
// ignore
}
return new String[0];
return "N/A";
}

private boolean isApplicableManifest(Manifest manifest) {
Expand Down

0 comments on commit 3ef5c89

Please sign in to comment.