bin/scms in scms-4.2.6 vs bin/scms in scms-4.3.0
- old
+ new
@@ -12,10 +12,13 @@
require 'Scms'
require "scms/version"
require 'scms/scms-watcher.rb'
require 'scms/scms-httpserver.rb'
+require 'scms/deploy-s3.rb'
+require 'scms/deploy-ftp.rb'
+
class String
def to_path(end_slash=false)
"#{'/' if self[0]=='\\'}#{self.split('\\').join('/')}#{'/' if end_slash}"
end
end
@@ -73,11 +76,15 @@
exit
end
# This displays the help screen, all programs are assumed to have this option.
opts.on( '-h', '--help', 'Display this help screen' ) do
puts "Default action = build; default website directory = current working directory"
+ puts ""
puts opts
+ puts ""
+ puts "Get the lowdown at: http://cprobert.github.io/Static-CMS"
+ puts ""
exit
end
end
optparse.parse!
@@ -94,15 +101,15 @@
# Globals: These can be used in the bootstrap.rb
$website = Folders[:website]
$watch = options[:watch]
$cmsmode = options[:mode] == "cms"
-# ScmsUtils.log "System root folder = #{Folders[:root]}"
-# ScmsUtils.log "Website folder = #{Folders[:website]}"
-# ScmsUtils.log "Destination dir = #{Folders[:destination]}"
-# ScmsUtils.log "Config dir = #{Folders[:config]}"
-# ScmsUtils.log "Mode = #{options[:mode]}"
+ScmsUtils.log "System root folder = #{Folders[:root]}"
+ScmsUtils.log "Website folder = #{Folders[:website]}"
+ScmsUtils.log "Destination dir = #{Folders[:destination]}"
+ScmsUtils.log "Config dir = #{Folders[:config]}"
+ScmsUtils.log "Mode = #{options[:mode]}"
raise "Invalid working directory! #{Folders[:website]}" if !File::directory?(Folders[:website])
Dir.chdir Folders[:website]
if options[:create] != nil
@@ -148,7 +155,12 @@
if options[:publish]
if File.exists?(File.join(Folders[:config], "_s3config.yml"))
puts "Deploying to S3"
mimetypefile = File.join(Folders[:assets], "mime.types")
S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile)
+ end
+
+ if File.exists?(File.join(Folders[:config], "_ftpconfig.yml"))
+ puts "Deploying to FTP"
+ FtpDeploy.sync(Folders[:website], Folders[:config])
end
end
\ No newline at end of file