Skip to content

Commit

Permalink
Create the parent directory before creating the new exploit file (closes
Browse files Browse the repository at this point in the history
 #122).
  • Loading branch information
postmodern committed May 1, 2024
1 parent 53008aa commit 299312c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ronin/exploits/cli/commands/new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ def initialize(**kwargs)
# The path to the new exploit file.
#
def run(file)
@directory = File.dirname(file)
@file_name = File.basename(file,File.extname(file))
@class_name = CommandKit::Inflector.camelize(@file_name)

mkdir @directory unless @directory == '.'

erb "exploit.rb.erb", file
chmod '+x', file
end
Expand Down

0 comments on commit 299312c

Please sign in to comment.