/usr/bin/mina is in mina 0.3.7-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #!/usr/bin/ruby
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems' unless Object.const_defined?(:Gem)
require 'mina'
require 'rake'
# Intercept: if invoked as 'mina --help', don't let it pass through Rake, or else
# we'll see the Rake help screen. Redirect it to 'mina help'.
if ARGV.delete('--help') || ARGV.delete('-h')
ARGV << 'help'
end
if ARGV.delete('--version') || ARGV.delete('-V')
puts "Mina, version v#{Mina.version}"
exit
end
if ARGV.delete('--simulate') || ARGV.delete('-S')
ENV['simulate'] = '1'
end
scope = self
Rake.application.instance_eval do
standard_exception_handling do
begin
# Initialize Rake and make it think it's Mina.
init 'mina'
# (The only way @rakefiles has only 1 value is if -f is specified.)
custom_rakefile = (@rakefiles.size == 1)
@rakefiles = ['Minafile', 'config/deploy.rb'] unless custom_rakefile
# Workaround: Rake 0.9+ doesn't record task descriptions unless it's needed.
# Need it for 'mina help'
if Rake::TaskManager.respond_to?(:record_task_metadata)
Rake::TaskManager.record_task_metadata = true
end
# Load the Mina Rake DSL.
require 'mina/rake'
# Allow running without a Rakefile
begin
load_rakefile if have_rakefile || custom_rakefile
rescue Exception
puts "Error loading Rakefile!"
raise "There may be a problem with config/deploy.rb and/or Rakefile"
end
# Run tasks
top_level
scope.mina_cleanup! if top_level_tasks.any?
rescue Mina::Failed => e
puts ""
scope.print_error "Command failed."
scope.print_stderr "#{e.message}"
exit(e.exitstatus > 255 ? e.exitstatus >> 8 : e.exitstatus)
end
end
end
|