scripts/localize.rb in standup-0.3.3 vs scripts/localize.rb in standup-0.3.4
- old
+ new
@@ -1,15 +1,13 @@
-Standup.script do
+Standup.script :local do
self.description = 'Put specified script into project configuration'
def run
- unless ENV['SCRIPT']
- bright_p "Specify script name with SCRIPT=name argument"
- return
- end
+ variants = Standup.scripts.keys.sort.select{|script_name| File.exists? File.expand_path("#{script_name}.rb", Standup.gem_scripts_path)}
+ script_name = argument '<script name>', 'script name', variants
FileUtils.mkdir_p(Standup.local_scripts_path)
- [ENV['SCRIPT'], "#{ENV['SCRIPT']}.rb"].each do |path|
+ [script_name, "#{script_name}.rb"].each do |path|
path = File.expand_path(path, Standup.gem_scripts_path)
if File.exists? path
FileUtils.cp_r path, Standup.local_scripts_path
end
end