Skip to content

Commit df53409

Browse files
committed
Make msfbase_dir an instance variable
1 parent 0f40fab commit df53409

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

msfupdate

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ while File.symlink?(msfbase)
99
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
1010
end
1111

12-
msfbase_dir = File.dirname(msfbase)
12+
@msfbase_dir = File.dirname(msfbase)
1313

1414
@args = ARGV.dup
1515

1616
# May be changed
1717
@configdir = File.expand_path(File.join(File.dirname(msfbase), "data", "svn"))
1818

19-
Dir.chdir(msfbase_dir)
19+
Dir.chdir(@msfbase_dir)
2020

2121
$stderr.puts "[*]"
2222
$stderr.puts "[*] Attempting to update the Metasploit Framework..."
@@ -29,12 +29,12 @@ if not (Process.uid == 0 or File.stat(msfbase).owned?)
2929
end
3030

3131

32-
def is_git(msfbase_dir)
33-
File.directory?(File.join(msfbase_dir, ".git"))
32+
def is_git
33+
File.directory?(File.join(@msfbase_dir, ".git"))
3434
end
3535

36-
def is_svn(msfbase_dir)
37-
File.directory?(File.join(msfbase_dir, ".svn"))
36+
def is_svn
37+
File.directory?(File.join(@msfbase_dir, ".svn"))
3838
end
3939

4040
# TODO
@@ -108,7 +108,7 @@ if is_git
108108
end
109109

110110
unless is_svn || is_git
111-
raise RuntimeError, "Cannot determine checkout type: `#{msfbase_dir}'"
111+
raise RuntimeError, "Cannot determine checkout type: `#{@msfbase_dir}'"
112112
end
113113

114114
if @actually_wait

0 commit comments

Comments
 (0)