Skip to content

Commit

Permalink
Update TIL generation
Browse files Browse the repository at this point in the history
  • Loading branch information
robmiller committed Oct 19, 2023
1 parent 9ce82fd commit ee98e6a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
Expand Up @@ -226,3 +226,12 @@
[submodule "vim/bundle/vim-grammarous"]
path = vim/bundle/vim-grammarous
url = https://github.com/rhysd/vim-grammarous.git
[submodule "vim/bundle/traces.vim"]
path = vim/bundle/traces.vim
url = https://github.com/markonm/traces.vim.git
[submodule "vim/bundle/vim-polyglot"]
path = vim/bundle/vim-polyglot
url = https://github.com/sheerun/vim-polyglot.git
[submodule "vim/bundle/vim-svelte"]
path = vim/bundle/vim-svelte
url = https://github.com/evanleck/vim-svelte.git
16 changes: 16 additions & 0 deletions bin/til
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby

require "open3"
require "date"
require "pry"

title = ARGV.join(" ")
Expand All @@ -12,6 +13,21 @@ filename = filename.strip.sub(/ was created$/, "")

system "vim", filename

puts File.read(filename)
puts
puts

print "Commit? (Y/n)"
answer = $stdin.gets.chomp.downcase

abort if answer == "n"

current_image_dir = "images/#{Date.today.strftime("%Y-%m")}}"

system "git", "add", filename
system "git", "add", "images/thumbnails"
if Dir.exist? current_image_dir
system "git", "add", current_image_dir
end
system "git", "commit", "-m", "Add post: #{title}"
system "git", "push"
1 change: 1 addition & 0 deletions vim/bundle/traces.vim
Submodule traces.vim added at 9663fc
1 change: 1 addition & 0 deletions vim/bundle/vim-polyglot
Submodule vim-polyglot added at bc8a81
1 change: 1 addition & 0 deletions vim/bundle/vim-svelte
Submodule vim-svelte added at 0e93ec

0 comments on commit ee98e6a

Please sign in to comment.