bin/sf in salesforce-deploy-tool-3.1.0 vs bin/sf in salesforce-deploy-tool-3.2.0
- old
+ new
@@ -48,21 +48,29 @@
config[:version_file] = ENV["SFDT_VERSION_FILE"] || config[:version_file]
config[:build_number_pattern] = ENV["SFDT_BUILD_NUMBER_PATTERN"] || config[:build_number_pattern]
config[:commit_hash_pattern] = ENV["SFDT_COMMIT_HASH_PATTERN"] || config[:commit_hash_pattern]
config[:deploy_ignore_files] = ENV["SFDT_DEPLOY_IGNORE_FILES"].nil? ? config[:deploy_ignore_files] : ENV["SFDT_DEPLOY_IGNORE_FILES"].split(',')
+# Ant options
+config[:libant] = ENV["SFDT_ANT_LIB"] || config[:libant]
+
# Minimal config validation
-abort "Config error: src_dir not found in #{GLOBAL_CONFIG_FILE} or through SFDT_SRC_DIR" if config[:src_dir].nil?
-abort "Config error: git_dir not found in #{GLOBAL_CONFIG_FILE} or through SFDT_GIT_DIR" if config[:git_dir].nil?
-abort "Config error: git_repo not found in #{GLOBAL_CONFIG_FILE} or through SFDT_GIT_DIR" if config[:git_repo].nil?
-abort "Config error: username not found in #{GLOBAL_CONFIG_FILE} or through SFDT_USERNAME" if config[:username].nil? && ARGV[0] != 'config'
-abort "Config error: password not found in #{GLOBAL_CONFIG_FILE} or through SFDT_PASSWORD" if config[:password].nil? && ARGV[0] != 'config'
+abort "Config error: src_dir not found in #{GLOBAL_CONFIG_FILE} or through SFDT_SRC_DIR" \
+ if config[:src_dir].nil? && !['-v'].include?(ARGV.first)
+abort "Config error: git_dir not found in #{GLOBAL_CONFIG_FILE} or through SFDT_GIT_DIR" \
+ if config[:git_dir].nil? && !['-v'].include?(ARGV.first)
+abort "Config error: git_repo not found in #{GLOBAL_CONFIG_FILE} or through SFDT_GIT_DIR" \
+ if config[:git_repo].nil? && !['-v'].include?(ARGV.first)
+abort "Config error: username not found in #{GLOBAL_CONFIG_FILE} or through SFDT_USERNAME" \
+ if config[:username].nil? && !['config','-v'].include?(ARGV.first)
+abort "Config error: password not found in #{GLOBAL_CONFIG_FILE} or through SFDT_PASSWORD" \
+ if config[:password].nil? && !['config','-v'].include?(ARGV.first)
# Create a temporary directory
config[:tmp_dir] = Dir.mktmpdir 'sfdt-'
-begin
SalesforceDeployTool::CLI.new.run config
+begin
rescue => e
puts "ERROR: #{e}"
exit 1
ensure
FileUtils.rm_rf config[:tmp_dir] if Dir.exists? config[:tmp_dir]