Commit ab43df5
xxwhirlpool
·
2026-09-27 16:41:02 -0400 EDT
parent c2b178f
add support for different file exts in paste.rb
1 files changed,
+5,
-1
+5,
-1
1@@ -2,8 +2,12 @@
2
3 require "tempfile"
4
5+# provide file ext thru arg
6+# if not provided it's .txt
7+ext = ARGV[0] || "txt"
8+
9 # define tmpfile
10-tmp = Tempfile.create("pico-pastes-")
11+tmp = Tempfile.create(["pico-pastes-", ".#{ext}"])
12 tmpfp = tmp.path
13
14 # use $EDITOR, if empty use `nano`