diff options
Diffstat (limited to 'src/slskd/Program.cs')
| -rw-r--r-- | src/slskd/Program.cs | 106 |
1 files changed, 89 insertions, 17 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 73d0e0f7..00e1b0cc 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -1,18 +1,33 @@ -// <copyright file="Program.cs" company="slskd Team"> -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. +// <copyright file="Program.cs" company="JP Dillingham"> +// ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ +// ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ +// █__ --█ █__ --█ ◄█ - █ +// █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█ +// ┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ +// │ Copyright (c) JP Dillingham. +// │ +// │ This program is free software: you can redistribute it and/or modify +// │ it under the terms of the GNU Affero General Public License as published +// │ by the Free Software Foundation, version 3. +// │ +// │ This program is distributed in the hope that it will be useful, +// │ but WITHOUT ANY WARRANTY; without even the implied warranty of +// │ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// │ GNU Affero General Public License for more details. +// │ +// │ You should have received a copy of the GNU Affero General Public License +// │ along with this program. If not, see https://www.gnu.org/licenses/. +// │ +// │ This program is distributed with Additional Terms pursuant to Section 7 +// │ of the AGPLv3. See the LICENSE file in the root directory of this +// │ project for the complete terms and conditions. +// │ +// │ https://slskd.org +// │ +// ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ╌ ╌╌╌╌ ╌ +// │ SPDX-FileCopyrightText: JP Dillingham +// │ SPDX-License-Identifier: AGPL-3.0-only +// ╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈ // </copyright> using Microsoft.Extensions.Logging; @@ -1524,7 +1539,7 @@ namespace slskd } } - private static void PrintLogo(string version) + private static void PrintLogoOld(string version) { try { @@ -1552,7 +1567,7 @@ namespace slskd var banner = @$" {logo} -╒════════════════════════════════════════════════════════╕ +┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ │ GNU AFFERO GENERAL PUBLIC LICENSE │ │ https://slskd.org │ │ │ @@ -1578,6 +1593,63 @@ namespace slskd } } + private static void PrintLogo(string version) + { + try + { + var padding = 56 - version.Length; + var paddingLeft = padding / 2; + var paddingRight = paddingLeft + (padding % 2); + + var centeredVersion = new string(' ', paddingLeft) + version + new string(' ', paddingRight); + + var logos = new[] + { + $@" + ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ + ▄▄▄▄▄▄▄ █ █ ▄▄▄▄▄▄▄ █ █▄▄▄ ▄▄▄█ █ + █__ --█ █ █ █__ --█ █ ◄█ █ - █ + █▄▄▄▄▄█ █▄▄█ █▄▄▄▄▄█ █▄▄█▄▄█ █▄▄▄▄▄█", + @$" + ▄▄▄▄ ▄▄▄▄ ▄▄▄▄ + ▄▄▄▄▄▄█ █▄▄▄▄▄█ █▄▄▄▄▄█ █ + █__ --█ █__ --█ ◄█ - █ + █▄▄▄▄▄█▄▄█▄▄▄▄▄█▄▄█▄▄█▄▄▄▄▄█", + }; + + var logo = logos[new System.Random().Next(0, logos.Length)]; + + var banner = @$" +{logo} +┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ ━ ━┉ ┉ ┉ +│ GNU Affero General Public License +│ └─▸ SPDX: AGPL-3.0-only +│ +│ https://slskd.org +│ +├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ╌ ╌╌╌╌ ╌ +│ {version}"; + + if (IsDevelopment) + { + banner += "\n│ └─▸ ⚠️ DEVELOPMENT"; + } + + if (IsCanary) + { + banner += "\n│ └─▸ 🧪 CANARY"; + } + + banner += "\n╰───────────────────────────────────────────╶──── ─ ─── ─ ── ──┈ ┈"; + + Console.WriteLine(banner); + } + catch + { + // noop. console may not be available in all cases. + } + } + private static void VerifyDirectory(string directory, bool createIfMissing = true, bool verifyWriteable = true) { if (!System.IO.Directory.Exists(directory)) |
