mirror of
https://github.com/Lakr233/GitLab-License-Generator.git
synced 2026-05-01 14:13:08 +03:00
fix: added year and user count validations
This commit is contained in:
committed by
GitHub
parent
66e00738a2
commit
9a70dabcfb
@@ -79,6 +79,19 @@ if license_plan != 'ultimate' && license_plan != 'premium' && license_plan !=
|
|||||||
puts "[!] use -h for help"
|
puts "[!] use -h for help"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Time.now.year > license_expire_year
|
||||||
|
puts "[!] license expiry year is set to #{license_expire_year} which is less than current year, this value must be greater than current year"
|
||||||
|
puts "[!] use -h for help"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if license_user_count < 1
|
||||||
|
puts "[!] license user count is set to #{license_user_count} which is less minumum user count possible"
|
||||||
|
puts "[!] use -h for help"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
# ==========
|
# ==========
|
||||||
|
|
||||||
puts "[*] loading keys..."
|
puts "[*] loading keys..."
|
||||||
@@ -116,7 +129,7 @@ license.licensee = {
|
|||||||
|
|
||||||
# required of course
|
# required of course
|
||||||
license.starts_at = Date.new(1976, 4, 1)
|
license.starts_at = Date.new(1976, 4, 1)
|
||||||
|
puts Date.new()
|
||||||
# required since gem gitlab-license v2.2.1
|
# required since gem gitlab-license v2.2.1
|
||||||
license.expires_at = Date.new(license_expire_year, 4, 1)
|
license.expires_at = Date.new(license_expire_year, 4, 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user