mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 11:42:19 -05:00
18 lines
594 B
Ruby
18 lines
594 B
Ruby
require "thor"
|
|
|
|
module Cli
|
|
class LibrariesCommand < Thor
|
|
COMMAND = "libraries"
|
|
DESCRIPTION = "manage libraries"
|
|
|
|
desc "scan", "scan library for filesystem changes"
|
|
option :name, required: false, type: :string, description: "library name to be scanned"
|
|
def scan
|
|
scope = Library.all # rubocop:disable Pundit/UsePolicyScope
|
|
scope = scope.where(name: options[:name]) if options[:name].presence
|
|
puts "\nQueueing #{scope.count} #{"library".pluralize(scope.count)} for filesystem scan"
|
|
scope.find_each(&:detect_filesystem_changes_later)
|
|
end
|
|
end
|
|
end
|