From b8285d5fe2f716d02a994072ed6c4475de0b7f12 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sat, 13 Apr 2024 20:52:30 -0700 Subject: [PATCH] Also create empty `exploits/` and `payloads/` directories in the new repo. --- lib/ronin/repos/cli/commands/new.rb | 2 ++ spec/cli/commands/new_spec.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/lib/ronin/repos/cli/commands/new.rb b/lib/ronin/repos/cli/commands/new.rb index e0a4f1e..4727f75 100644 --- a/lib/ronin/repos/cli/commands/new.rb +++ b/lib/ronin/repos/cli/commands/new.rb @@ -67,6 +67,8 @@ def run(path) @github_user = Core::Git.github_user || ENV['USER'] mkdir path + mkdir File.join(path,'exploits') + mkdir File.join(path,'payloads') erb 'README.md.erb', File.join(path,'README.md') Dir.chdir(path) do diff --git a/spec/cli/commands/new_spec.rb b/spec/cli/commands/new_spec.rb index 0c892aa..85084b1 100644 --- a/spec/cli/commands/new_spec.rb +++ b/spec/cli/commands/new_spec.rb @@ -33,6 +33,14 @@ expect(File.directory?(@path)).to be(true) end + it "must create the exploits/ directory within the repo directory" do + expect(File.directory?(File.join(@path,'exploits'))).to be(true) + end + + it "must create the payloads/ directory within the repo directory" do + expect(File.directory?(File.join(@path,'payloads'))).to be(true) + end + it "must create a git repository within the directory" do expect(File.directory?(File.join(@path,'.git'))).to be(true) end