mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-07 17:42:46 -05:00
Improve minimum version by using shards.yml crystal attribute
This commit is contained in:
parent
143077be07
commit
22e269ba99
@ -40,7 +40,7 @@ development_dependencies:
|
|||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: ~> 1.6.1
|
version: ~> 1.6.1
|
||||||
|
|
||||||
crystal: ">= 1.10.0, < 2.0.0"
|
crystal: ">= 1.20.0, < 2.0.0"
|
||||||
|
|
||||||
license: AGPL-3.0-only
|
license: AGPL-3.0-only
|
||||||
|
|
||||||
|
|||||||
@ -54,11 +54,18 @@ require "./invidious/jobs/*"
|
|||||||
# encouraging the user compiling Invidious, to update it's Crystal compiler
|
# encouraging the user compiling Invidious, to update it's Crystal compiler
|
||||||
# version.
|
# version.
|
||||||
{% begin %}
|
{% begin %}
|
||||||
{% minimum_version = "1.14.1" %}
|
# `-Dskip_version_check` compile-time flag, for development purposes
|
||||||
{% if compare_versions(Crystal::VERSION, minimum_version) < 0 %}
|
# or weird installations that lack the `shard.yml` file when compiling
|
||||||
{{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \
|
# Invidious.
|
||||||
You currently have Crystal version #{Crystal::VERSION} installed. \
|
{% if !flag?(:skip_version_check) %}
|
||||||
We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }}
|
{% shard_yml = read_file("shard.yml") %}
|
||||||
|
{% crystal_constraint = shard_yml.split('\n').find { |line| line.starts_with?("crystal:") } %}
|
||||||
|
{% minimum_version = crystal_constraint.split('"')[1].split(",").first.split(">=").last.strip %}
|
||||||
|
{% if compare_versions(Crystal::VERSION, minimum_version) < 0 %}
|
||||||
|
{{ raise "Crystal version #{minimum_version} or newer is required to build Invidious. \
|
||||||
|
You currently have Crystal version #{Crystal::VERSION} installed. \
|
||||||
|
We recommend that you install it following the way that the Crystal compiler itself recommend for your OS, see: https://crystal-lang.org/install/" }}
|
||||||
|
{% end %}
|
||||||
{% end %}
|
{% end %}
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user