parent
17e8ab37a0
commit
46400c0689
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "fwdekker.com",
|
"name": "fwdekker.com",
|
||||||
"version": "0.39.0",
|
"version": "0.39.1",
|
||||||
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
||||||
"author": "Felix W. Dekker",
|
"author": "Felix W. Dekker",
|
||||||
"browser": "dist/bundle.js",
|
"browser": "dist/bundle.js",
|
||||||
|
|
|
@ -535,12 +535,12 @@ return new Command(
|
||||||
return new Command(
|
return new Command(
|
||||||
(input, streams) => {
|
(input, streams) => {
|
||||||
josh.environment.set("user", "");
|
josh.environment.set("user", "");
|
||||||
return ExitCode.OK;
|
return parseInt(input.args[0] || "0");
|
||||||
},
|
},
|
||||||
\`close session\`,
|
\`close session\`,
|
||||||
\`exit\`,
|
\`exit\`,
|
||||||
\`Closes the terminal session.\`,
|
\`Closes the terminal session.\`,
|
||||||
new InputValidator({maxArgs: 0})
|
new InputValidator({minArgs: 0, maxArgs: 1})
|
||||||
)`,
|
)`,
|
||||||
"false": /* language=JavaScript */ `\
|
"false": /* language=JavaScript */ `\
|
||||||
return new Command(
|
return new Command(
|
||||||
|
|
|
@ -360,10 +360,24 @@ describe("commands", () => {
|
||||||
beforeEach(() => loadCommand("exit"));
|
beforeEach(() => loadCommand("exit"));
|
||||||
|
|
||||||
|
|
||||||
it("changes the current user", () => {
|
it("removes the current user", () => {
|
||||||
|
environment.set("user", "wish");
|
||||||
|
|
||||||
expect(execute("exit")).to.equal(ExitCode.OK);
|
expect(execute("exit")).to.equal(ExitCode.OK);
|
||||||
expect(environment.get("user")).to.equal("");
|
expect(environment.get("user")).to.equal("");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("has exit code of OK by default", () => {
|
||||||
|
environment.set("status", "9");
|
||||||
|
|
||||||
|
expect(execute("exit")).to.equal(ExitCode.OK);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("returns the user-supplied exit code", () => {
|
||||||
|
environment.set("status", "1");
|
||||||
|
|
||||||
|
expect(execute("exit 46")).to.equal(46);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("false", () => {
|
describe("false", () => {
|
||||||
|
|
Loading…
Reference in New Issue