Skip to content

Commit 2004274

Browse files
committed
Create the parent directory before creating the new payload file (closes #115).
1 parent b99d436 commit 2004274

File tree

1 file changed

+3
-0
lines changed
  • lib/ronin/payloads/cli/commands

1 file changed

+3
-0
lines changed

lib/ronin/payloads/cli/commands/new.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,12 @@ def initialize(**kwargs)
9999
# The path to the new payload file.
100100
#
101101
def run(file)
102+
@directory = File.dirname(file)
102103
@file_name = File.basename(file,File.extname(file))
103104
@class_name = CommandKit::Inflector.camelize(@file_name)
104105

106+
mkdir @directory unless @directory == '.'
107+
105108
erb "payload.rb.erb", file
106109
chmod '+x', file
107110
end

0 commit comments

Comments
 (0)