mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
move big CLIte text to a variable instead of writing it twice
This commit is contained in:
parent
6128bc86db
commit
d5bb8fd814
1 changed files with 9 additions and 14 deletions
|
|
@ -290,6 +290,13 @@ data/about.txt:/usr/share/site/about:0:0:-rw-rw-r--`;
|
|||
clite.io.close(fd);
|
||||
}
|
||||
// check cookies for login
|
||||
var clite_text =`
|
||||
_____ _ _____ _
|
||||
/ ____| | |_ _| |
|
||||
| | | | | | | |_ ___
|
||||
| | | | | | | __/ _ \\
|
||||
| |____| |____ _| |_| || __/
|
||||
\\_____|______|_____|\\__\\___|`;
|
||||
clite.log.write('Checking for user session');
|
||||
if (clite.user.init(vfsapi)) {// if logged in:
|
||||
clite.log.write('found user session?');
|
||||
|
|
@ -299,23 +306,11 @@ data/about.txt:/usr/share/site/about:0:0:-rw-rw-r--`;
|
|||
// read in /usr/share/introduction and write to shell
|
||||
if (window.location.protocol == 'file:') {
|
||||
clite.user.genGuest();
|
||||
clite.shell.writeLine(`
|
||||
_____ _ _____ _
|
||||
/ ____| | |_ _| |
|
||||
| | | | | | | |_ ___
|
||||
| | | | | | | __/ _ \\
|
||||
| |____| |____ _| |_| || __/
|
||||
\\_____|______|_____|\\__\\___|`);
|
||||
clite.shell.writeLine(clite_text);
|
||||
}else{
|
||||
var fd = clite.io.open('/usr/share/introduction',function(fd) {
|
||||
clite.user.genGuest();
|
||||
clite.shell.writeLine(`
|
||||
_____ _ _____ _
|
||||
/ ____| | |_ _| |
|
||||
| | | | | | | |_ ___
|
||||
| | | | | | | __/ _ \\
|
||||
| |____| |____ _| |_| || __/
|
||||
\\_____|______|_____|\\__\\___|`);
|
||||
clite.shell.writeLine(clite_text);
|
||||
if (!fd)
|
||||
return;
|
||||
var d = clite.io.readAll(fd);
|
||||
|
|
|
|||
Loading…
Reference in a new issue