feat: add version
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Glenn Y. Rolland 2024-01-03 17:03:40 +01:00
parent 3a324c8846
commit 3244130a51
4 changed files with 23 additions and 0 deletions

View file

@ -4,6 +4,10 @@ shards:
git: https://github.com/dscottboggs/magic.cr.git
version: 1.1.0
version_from_shard:
git: https://github.com/hugopl/version_from_shard.git
version: 1.2.5
walk:
git: https://github.com/alexherbo2/walk.cr.git
version: 0.1.0+git.commit.765d758c0f966cccc98c1d81c7ccd0c1f71928e3

View file

@ -14,6 +14,8 @@ dependencies:
github: dscottboggs/magic.cr
walk:
github: alexherbo2/walk.cr
version_from_shard:
github: hugopl/version_from_shard
# description: |
# Short description of chatgpt-preloader

View file

@ -2,6 +2,7 @@ require "option_parser"
require "yaml"
require "./models/root_config"
require "./version"
module CodePreloader
class Config
@ -58,6 +59,11 @@ module CodePreloader
@footer_prompt_file_path = footer_prompt_file
end
parser.on("--version", "Show version") do
STDOUT.puts "#{PROGRAM_NAME} #{VERSION}"
exit(0)
end
parser.on("-h", "--help", "Show this help") do
STDERR.puts parser
exit

11
src/version.cr Normal file
View file

@ -0,0 +1,11 @@
require "version_from_shard"
module CodePreloader
PROGRAM_NAME = "CodePreloader"
VersionFromShard.declare
end
# Nom du script et version
# SCRIPT_NAME = "SignalSpamReporter"
# SCRIPT_VERSION = "1.2"