Skip to content

Commit

Permalink
boilerplate readme generator
Browse files Browse the repository at this point in the history
  • Loading branch information
therealadam committed Nov 26, 2022
1 parent 75c14d1 commit 528aa03
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions bin/readme-here
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env ruby

config = {
dir: Dir.getwd || ARGV[0] || '/Users/adam/Desktop',
filename: 'readme.md',
markdown_editor: 'Byword',
}
$boilerplate = <<~MD
# A new, exciting thing happens here!
--
Adam Keys / @therealadam / [email protected]
MD

#------

require 'pathname'

def make_readme(dir:, filename:, markdown_editor:)
path = Pathname.new(dir) + filename
unless path.exist?
path.write($boilerplate)
end

`open -a #{markdown_editor} #{path}`
end

if __FILE__ == $0
make_readme(config)

exit 0
end

0 comments on commit 528aa03

Please sign in to comment.