#!/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 '-> 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 '-> Removing .openshift directory' FileUtils.rm_rf('.openshift') puts '-> Copying .openshift directory' FileUtils.cp_r(File.expand_path('../../templates/openshift', __FILE__), '.openshift') File.open('.openshift/openshifter', 'w') do |file| file.print(config) end puts '-> You may change the configuration in .openshift/openshifter file.'