lib/sifttter_redux/dbu.rb in sifttter-redux-0.3.3 vs lib/sifttter_redux/dbu.rb in sifttter-redux-0.3.4
- old
+ new
@@ -3,10 +3,11 @@
# DBU Module
#
# Wrapper module for the Dropbox Uploader project
# ======================================================
module DBU
+ CONFIG_FILEPATH = File.join(ENV['HOME'], '.dropbox_uploader')
DEFAULT_MESSAGE = 'RUNNING DROPBOX UPLOADER'
# ----------------------------------------------------
# download method
#
@@ -55,9 +56,12 @@
else
CliMessage.info_block("Downloading Dropbox Uploader to #{ path }...", 'Done.', true) do
system "git clone https://github.com/andreafabrizi/Dropbox-Uploader.git #{ path }"
end
end
+
+ # If the user has never configured Dropbox Uploader, have them do it here.
+ system "#{ @dbu }" unless File.exists?(CONFIG_FILEPATH)
Configuration.add_section('db_uploader')
Configuration['db_uploader'].merge!('local_filepath' => path)
else
puts "Sorry, but #{ path } isn't a valid directory."