bin/openshifter-setup in openshifter-0.1 vs bin/openshifter-setup in openshifter-0.2

- old
+ new

@@ -1,28 +1,29 @@ #!/usr/bin/env ruby require File.expand_path('../../lib/openshifter/init', __FILE__) +if File.exists?('.openshift/openshifter') and !ARGV.include?('--upgrade') + puts '-> You are already set up.' + exit(0) +end + unless File.exists?('.openshift/openshifter') - puts '-> Removing default .openshift directory' - FileUtils.rm_rf('.openshift') + puts '-> Cleaning default mess' + FileUtils.rm_rf('src') + FileUtils.rm_rf('pom.xml') + FileUtils.rm_rf('README') + FileUtils.rm_rf('deployments') +else + config = File.read('.openshift/openshifter') +end - puts '-> Copying openshifter .openshift direcotry' - FileUtils.cp_r(File.expand_path('../../templates/openshift', __FILE__), '.openshift') +puts '-> Removing .openshift directory' +FileUtils.rm_rf('.openshift') - puts '-> Cleaning other default mess' - FileUtils.rm_rf('src') - FileUtils.rm_rf('pom.xml') - FileUtils.rm_rf('README') -end +puts '-> Copying .openshift directory' +FileUtils.cp_r(File.expand_path('../../templates/openshift', __FILE__), '.openshift') -unless File.exists?('.openshift/lib/jruby.jar') - puts "-> Downloading jRuby" - `curl -o .openshift/lib/jruby.jar "http://jruby.org.s3.amazonaws.com/downloads/1.6.6/jruby-complete-1.6.6.jar"` +File.open('.openshift/openshifter', 'w') do |file| + file.print(config) end -unless File.exists?('.openshift/lib/jruby-rack.jar') - puts "-> Downloading jRuby-Rack" - `curl -o .openshift/lib/jruby-rack.jar "http://repository.codehaus.org/org/jruby/rack/jruby-rack/1.1.3/jruby-rack-1.1.3.jar"` -end - -puts '-> Installing Bundler' -puts `java -jar .openshift/lib/jruby.jar -S gem install bundler --no-ri --no-rdoc` +puts '-> You may change the configuration in .openshift/openshifter file.' \ No newline at end of file