bin/2cdn in 2cdn-0.1.7 vs bin/2cdn in 2cdn-0.1.8
- old
+ new
@@ -9,14 +9,14 @@
Options:
-h, --help Show help
-V, --version Show program version
Basic usage:
- 2cdn help # Show help
- 2cdn setup # Init oss file paths
- 2cdn upload # Upload resources to Aliyun Oss
- 2cdn debug # Change resources path to local path
+ 2cdn help # Show help
+ 2cdn setup # Init oss file paths
+ 2cdn upload # Upload resources to Aliyun Oss `2cdn upload $local_file $remote_file $is_delete`
+ 2cdn download # Download resources path to local path
EOB
end
def app_path
@app_path ||= `pwd`.gsub("\n", '')
@@ -37,13 +37,10 @@
exit
end
if ARGV[0] =~ /^setup$/
(system "mkdir #{app_path}/config") unless File.directory?("#{app_path}/config")
- (system "mkdir #{app_path}/images") unless File.directory?("#{app_path}/images")
- (system "mkdir #{app_path}/javascripts") unless File.directory?("#{app_path}/javascripts")
- (system "mkdir #{app_path}/css") unless File.directory?("#{app_path}/css")
system "touch #{config_file}"
if File.read(config_file).length<=0
File.open(config_file, 'w') do |f|
f.puts <<-EOB
access_key_id: YOUR_ACCESS_ID
@@ -64,11 +61,11 @@
unless File.exist?(config_file)
puts "#{config_file} does not exist\nPlease run `2cdn init` first."
exit
end
- AutoAliCDN::Oss.oss_upload(config_file, app_path)
+ AutoAliCDN::Oss.oss_upload(config_file, app_path, ARGV[1], ARGV[2], ARGV[3])
end
-if ARGV[0] =~ /^debug$/
- AutoAliCDN::Oss.oss_debug(config_file, app_path)
-end
\ No newline at end of file
+if ARGV[0] =~ /^download$/
+ AutoAliCDN::Oss.oss_download(config_file, app_path, ARGV[1] , ARGV[2])
+end