update scan
Some checks are pending
Ruby Gem / rebuild (push) Waiting to run
Publish Container to Github at dev / build-and-push-image (push) Waiting to run

This commit is contained in:
Jonny_Bro (Nikita) 2025-02-04 17:15:15 +05:00
parent 13dce28303
commit 3105a74320
2 changed files with 12 additions and 4 deletions

View file

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
echo "Updating perms"
chmod -R 777 .
echo "[i] GitLab License Generator" echo "[i] GitLab License Generator"
echo "[i] Copyright (c) 2023 Tim Cook, All Rights Not Reserved" echo "[i] Copyright (c) 2023 Tim Cook, All Rights Not Reserved"
LICENSE_NAME="${LICENSE_NAME:-"Tim Cook"}" LICENSE_NAME="${LICENSE_NAME:-"Tim Cook"}"

View file

@ -7,8 +7,12 @@ require 'optparse'
OptionParser.new do |opts| OptionParser.new do |opts|
opts.banner = "Usage: scan.features.rb [options]" opts.banner = "Usage: scan.features.rb [options]"
opts.on("-s", "--src-dir PATH", "Specify gitlab source dir (required)") do |v| opts.on("-s", "--src-dir PATH", "Specify gitlab source dir (required if --features-file is ommited)") do |v|
GITLAB_SRC_DIR = File.expand_path(v) GITLAB_FEATURES_FILE="#{File.expand_path(v)}/ee/app/models/gitlab_subscriptions/features.rb"
end
opts.on("-f", "--features-file PATH", "Specify gitlab features path (required if --src-dir is ommited)") do |v|
GITLAB_FEATURES_FILE = File.expand_path(v)
end end
opts.on("-o", "--output PATH", "Output to json file (required)") do |v| opts.on("-o", "--output PATH", "Output to json file (required)") do |v|
@ -22,11 +26,12 @@ OptionParser.new do |opts|
end end
.parse! .parse!
if GITLAB_SRC_DIR.nil? || EXPORT_JSON_FILE.nil? if GITLAB_FEATURES_FILE.nil? || EXPORT_JSON_FILE.nil?
puts "[!] missing required options" puts "[!] missing required options"
puts "[!] use -h for help" puts "[!] use -h for help"
exit 1 exit 1
end end
puts "Reading features from #{GITLAB_FEATURES_FILE}"
def ignore_exception def ignore_exception
begin begin
@ -37,7 +42,7 @@ end
puts "[*] loading features.rb..." puts "[*] loading features.rb..."
ignore_exception do ignore_exception do
require_relative "#{GITLAB_SRC_DIR}/ee/app/models/gitlab_subscriptions/features.rb" require_relative "#{GITLAB_FEATURES_FILE}"
end end
ALL_FEATURES = [] ALL_FEATURES = []