Skip to content

Commit

Permalink
Only write input file scaffold, if it doesn’t exist already (#8)
Browse files Browse the repository at this point in the history
* Only write input file scaffold, if it doesn’t exist already

Signed-off-by: Stephan Kämper <the.tester@seasidetesting.com>

* Fix file system check

Signed-off-by: Stephan Kämper <the.tester@seasidetesting.com>

Signed-off-by: Stephan Kämper <the.tester@seasidetesting.com>
  • Loading branch information
s2k authored Dec 12, 2022
1 parent da292ef commit ce6d79e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/advent_of_code_cli/commands/scaffold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def execute
Dir.mkdir("inputs")
end

say("Creating file: #{input_file_name}...")
create_file(input_file_name)
unless File.exist?(input_file_name)
say("Creating file: #{input_file_name}...")
create_file(input_file_name)
end

unless Dir.exist?("examples")
say("Creating examples directory...")
Expand Down

0 comments on commit ce6d79e

Please sign in to comment.