forked from mbryzek/schema-evolution-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.rb
executable file
·32 lines (27 loc) · 1.03 KB
/
configure.rb
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
#!/usr/bin/env ruby
#
# Preprares schema-evolution-manager for installation. See also install.rb
# script in this directory. Main work is to simply check a few
# dependencies and to capture the directory into which the user
# would like to install schema-evolution-manager.
#
# == Usage
# ./configure.rb
# You will be asked for required options
#
# ./configure.rb --prefix /usr/local
# Configure installer for the specified lib and bin directories
#
load File.join(File.dirname(__FILE__), 'lib/schema-evolution-manager.rb')
SchemaEvolutionManager::Library.set_verbose(true)
args = SchemaEvolutionManager::Args.from_stdin(:optional => %w(prefix))
prefix = args.prefix || SchemaEvolutionManager::Ask.for_string("prefix", :default => "/usr/local")
lib_dir = File.join(prefix, "lib")
bin_dir = File.join(prefix, "bin")
target = "./install.rb"
template = SchemaEvolutionManager::InstallTemplate.new(:lib_dir => lib_dir, :bin_dir => bin_dir)
template.write_to_file(target)
puts ""
puts "To complete installation, run:"
puts " sudo #{target}"
puts ""