From 1da3141e8203f7173f48f3d65857806259b4a0e6 Mon Sep 17 00:00:00 2001 From: Dominic Grimm Date: Wed, 9 Feb 2022 17:10:16 +0100 Subject: [PATCH] Updated CLI --- docker/backend/shard.lock | 12 ++++++++---- docker/backend/shard.yml | 6 ++---- docker/backend/src/backend/authors.cr | 5 +++++ docker/backend/src/backend/license.cr | 3 +++ docker/backend/src/backend/version.cr | 4 ++-- docker/backend/src/cli/backend.cr | 17 +++++++++++++---- 6 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 docker/backend/src/backend/authors.cr create mode 100644 docker/backend/src/backend/license.cr diff --git a/docker/backend/shard.lock b/docker/backend/shard.lock index 9280a55..731cd9f 100644 --- a/docker/backend/shard.lock +++ b/docker/backend/shard.lock @@ -8,10 +8,6 @@ shards: git: https://github.com/mrrooijen/commander.git version: 0.4.0 - compiled_license: - git: https://git.dergrimm.net/dergrimm/compiled_license.git - version: 2.0.0 - db: git: https://github.com/crystal-lang/crystal-db.git version: 0.10.1 @@ -80,6 +76,10 @@ shards: git: https://github.com/ysbaddaden/pool.git version: 0.2.4 + pretty: + git: https://github.com/maiha/pretty.cr.git + version: 1.1.1 + promise: git: https://github.com/spider-gazelle/promise.git version: 3.0.0 @@ -104,6 +104,10 @@ shards: git: https://github.com/spider-gazelle/secrets-env.git version: 1.3.1 + shard: + git: https://github.com/maiha/shard.cr.git + version: 0.3.1 + version_from_shard: git: https://github.com/hugopl/version_from_shard.git version: 1.2.5 diff --git a/docker/backend/shard.yml b/docker/backend/shard.yml index 99a74c1..6eb369b 100644 --- a/docker/backend/shard.yml +++ b/docker/backend/shard.yml @@ -34,8 +34,6 @@ dependencies: github: spider-gazelle/secrets-env quartz_mailer: github: amberframework/quartz-mailer - version_from_shard: - github: hugopl/version_from_shard kilt: github: jeromegn/kilt email: @@ -50,5 +48,5 @@ dependencies: github: spider-gazelle/crystal-ldap ldap_escape: git: https://git.dergrimm.net/dergrimm/ldap_escape.git - compiled_license: - git: https://git.dergrimm.net/dergrimm/compiled_license.git + shard: + github: maiha/shard.cr diff --git a/docker/backend/src/backend/authors.cr b/docker/backend/src/backend/authors.cr new file mode 100644 index 0000000..c8ef687 --- /dev/null +++ b/docker/backend/src/backend/authors.cr @@ -0,0 +1,5 @@ +require "shard" + +module Backend + AUTHORS = Shard.authors +end diff --git a/docker/backend/src/backend/license.cr b/docker/backend/src/backend/license.cr new file mode 100644 index 0000000..718ac1c --- /dev/null +++ b/docker/backend/src/backend/license.cr @@ -0,0 +1,3 @@ +module Backend + LICENSE = {{ read_file "LICENSE" }} +end diff --git a/docker/backend/src/backend/version.cr b/docker/backend/src/backend/version.cr index 6d18635..f9cffd3 100644 --- a/docker/backend/src/backend/version.cr +++ b/docker/backend/src/backend/version.cr @@ -1,5 +1,5 @@ -require "version_from_shard" +require "shard" module Backend - VersionFromShard.declare + VERSION = Shard.version end diff --git a/docker/backend/src/cli/backend.cr b/docker/backend/src/cli/backend.cr index 40e6f48..b808c03 100644 --- a/docker/backend/src/cli/backend.cr +++ b/docker/backend/src/cli/backend.cr @@ -1,5 +1,4 @@ require "commander" -require "compiled_license" require "../backend" cli = Commander::Command.new do |cmd| @@ -21,12 +20,22 @@ cli = Commander::Command.new do |cmd| end cmd.commands.add do |c| - c.use = "licenses" - c.short = "Prints licenses of projects used" + c.use = "authors" + c.short = "Prints authors" c.long = c.short c.run do - puts CompiledLicense::LICENSES + puts Backend::AUTHORS.join("\n") + end + end + + cmd.commands.add do |c| + c.use = "license" + c.short = "Prints license" + c.long = c.short + + c.run do + puts Backend::LICENSE end end