mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 00:52:45 -05:00
Improve minimum version by using shards.yml crystal attribute
This commit is contained in:
parent
143077be07
commit
22e269ba99
@ -10,7 +10,7 @@ targets:
|
||||
main: src/invidious.cr
|
||||
|
||||
description: |
|
||||
Invidious is an alternative front-end to YouTube
|
||||
Invidious is an alternative front-end to YouTube
|
||||
|
||||
dependencies:
|
||||
pg:
|
||||
@ -40,7 +40,7 @@ development_dependencies:
|
||||
github: crystal-ameba/ameba
|
||||
version: ~> 1.6.1
|
||||
|
||||
crystal: ">= 1.10.0, < 2.0.0"
|
||||
crystal: ">= 1.20.0, < 2.0.0"
|
||||
|
||||
license: AGPL-3.0-only
|
||||
|
||||
|
||||
@ -54,11 +54,18 @@ require "./invidious/jobs/*"
|
||||
# encouraging the user compiling Invidious, to update it's Crystal compiler
|
||||
# version.
|
||||
{% begin %}
|
||||
{% minimum_version = "1.14.1" %}
|
||||
{% 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/" }}
|
||||
# `-Dskip_version_check` compile-time flag, for development purposes
|
||||
# or weird installations that lack the `shard.yml` file when compiling
|
||||
# Invidious.
|
||||
{% if !flag?(:skip_version_check) %}
|
||||
{% 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 %}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user