🐛 Fix 'list-hosts' when empty #13

Merged
KaKi87 merged 5 commits from Androz2091/synced-over-ssh:fix-lists-no-host into dev 2023-03-25 19:35:41 +01:00
Showing only changes of commit d2934b51bb - Show all commits

View file

@ -9,8 +9,10 @@ export default ({
user user
}) => { }) => {
screenStream.stdin.write( screenStream.stdin.write(
(user.getHosts().length === 0 ? getString('listHosts.noHosts') : (
new AsciiTable() user.getHosts().length === 0
? getString('listHosts.noHosts')
: new AsciiTable()
.setHeading('Host', 'URI') .setHeading('Host', 'URI')
.addRowMatrix(user.getHosts().map(host => [ .addRowMatrix(user.getHosts().map(host => [
host.chain host.chain
@ -27,7 +29,8 @@ export default ({
getString('home.hostUri', { host }) getString('home.hostUri', { host })
])) ]))
.toString() .toString()
.replaceAll('\n', '\r\n')) .replaceAll('\n', '\r\n')
)
+ +
'\r\n' '\r\n'
); );