forked from tools/josh
1
0
Fork 0

Add status code in prefix

Fixes #125.
This commit is contained in:
Florine W. Dekker 2020-06-30 10:43:24 +02:00
parent 70af6d727e
commit 17d8f2dbba
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "fwdekker.com",
"version": "0.33.10",
"version": "0.34.0",
"description": "The source code of [my personal website](https://fwdekker.com/).",
"author": "Felix W. Dekker",
"browser": "dist/bundle.js",

View File

@ -102,3 +102,8 @@ body {
#terminalSuggestions {
display: block;
}
.errorMessage {
color: red;
}

View File

@ -110,7 +110,10 @@ export class Shell {
.map(part => new Directory().nameString(part.fileName, part))
.join("/");
return `${userName}@fwdekker.com <span class="prefixPath">${rootText}${partText}</span>&gt; `;
const status = this.environment.get("status");
const statusString = status === "0" ? "" : ` <span class="errorMessage">[${status}]</span>`;
return `${userName}@fwdekker.com <span class="prefixPath">${rootText}${partText}</span>${statusString}&gt; `;
}