Replace deprecated File.exists? with File.exist? (#2740)
This commit is contained in:
2
Rakefile
2
Rakefile
@@ -134,7 +134,7 @@ task :beef_start => 'beef' do
|
|||||||
config = YAML.safe_load(File.read('./config.yaml'))
|
config = YAML.safe_load(File.read('./config.yaml'))
|
||||||
config['beef']['credentials']['user'] = test_user
|
config['beef']['credentials']['user'] = test_user
|
||||||
config['beef']['credentials']['passwd'] = test_pass
|
config['beef']['credentials']['passwd'] = test_pass
|
||||||
Dir.mkdir('tmp') unless Dir.exists?('tmp')
|
Dir.mkdir('tmp') unless Dir.exist?('tmp')
|
||||||
File.open(@beef_config_file, 'w') { |f| YAML.dump(config, f) }
|
File.open(@beef_config_file, 'w') { |f| YAML.dump(config, f) }
|
||||||
|
|
||||||
# set the environment creds -- in case we're using bad_fred
|
# set the environment creds -- in case we're using bad_fred
|
||||||
|
|||||||
2
beef
2
beef
@@ -185,7 +185,7 @@ db_file = config.get('beef.database.file')
|
|||||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||||
print_info 'Resetting the database for BeEF.'
|
print_info 'Resetting the database for BeEF.'
|
||||||
begin
|
begin
|
||||||
File.delete(db_file) if File.exists?(db_file)
|
File.delete(db_file) if File.exist?(db_file)
|
||||||
rescue => e
|
rescue => e
|
||||||
print_error("Could not remove '#{db_file}' database file: #{e.message}")
|
print_error("Could not remove '#{db_file}' database file: #{e.message}")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|||||||
@@ -6486,7 +6486,7 @@ module RbReadline
|
|||||||
# `%' for character special devices
|
# `%' for character special devices
|
||||||
# `#' for block special devices
|
# `#' for block special devices
|
||||||
def stat_char(filename)
|
def stat_char(filename)
|
||||||
return nil if !File.exists?(filename)
|
return nil if !File.exist?(filename)
|
||||||
|
|
||||||
return '/' if File.directory?(filename)
|
return '/' if File.directory?(filename)
|
||||||
return '%' if File.chardev?(filename)
|
return '%' if File.chardev?(filename)
|
||||||
|
|||||||
@@ -6486,7 +6486,7 @@ module RbReadline
|
|||||||
# `%' for character special devices
|
# `%' for character special devices
|
||||||
# `#' for block special devices
|
# `#' for block special devices
|
||||||
def stat_char(filename)
|
def stat_char(filename)
|
||||||
return nil if !File.exists?(filename)
|
return nil if !File.exist?(filename)
|
||||||
|
|
||||||
return '/' if File.directory?(filename)
|
return '/' if File.directory?(filename)
|
||||||
return '%' if File.chardev?(filename)
|
return '%' if File.chardev?(filename)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ RSpec.describe 'BeEF API Rate Limit' do
|
|||||||
|
|
||||||
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
if BeEF::Core::Console::CommandLine.parse[:resetdb]
|
||||||
print_info 'Resetting the database for BeEF.'
|
print_info 'Resetting the database for BeEF.'
|
||||||
File.delete(db_file) if File.exists?(db_file)
|
File.delete(db_file) if File.exist?(db_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Load up DB and migrate if necessary
|
# Load up DB and migrate if necessary
|
||||||
|
|||||||
@@ -43,19 +43,19 @@ else
|
|||||||
end
|
end
|
||||||
ACTION = action
|
ACTION = action
|
||||||
|
|
||||||
if !File.exists?(EXT_ZIP_NAME)
|
if !File.exist?(EXT_ZIP_NAME)
|
||||||
puts "[-] Error: #{EXT_ZIP_NAME} does not exist"
|
puts "[-] Error: #{EXT_ZIP_NAME} does not exist"
|
||||||
help()
|
help()
|
||||||
end
|
end
|
||||||
|
|
||||||
if ARGV[2] != nil and File.exists?(ARGV[2])
|
if ARGV[2] != nil and File.exist?(ARGV[2])
|
||||||
DESCRIPTION = File.new(ARGV[2]).read()
|
DESCRIPTION = File.new(ARGV[2]).read()
|
||||||
puts "[*] Using description from #{ARGV[2]}"
|
puts "[*] Using description from #{ARGV[2]}"
|
||||||
else
|
else
|
||||||
DESCRIPTION = ""
|
DESCRIPTION = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
if ARGV[3] != nil and File.exists?(ARGV[3])
|
if ARGV[3] != nil and File.exist?(ARGV[3])
|
||||||
SCREENSHOT_NAME = ARGV[3]
|
SCREENSHOT_NAME = ARGV[3]
|
||||||
puts "[*] Using screenshot from #{SCREENSHOT_NAME}"
|
puts "[*] Using screenshot from #{SCREENSHOT_NAME}"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user