Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Quick bugfixes tag-extract

  • Loading branch information...
commit 157ec6dbd2e79eeef05e1ea7bae63819442c6b10 1 parent d94bbb4
@houshuang authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 tag-extract.rb
View
11 tag-extract.rb
@@ -2,7 +2,7 @@
$:.push(File.dirname($0))
require 'utility-functions'
-unless ARGV.size == 3
+unless ARGV.size >= 2
puts "Usage: ruby taskpaper-extract.rb <scrivener|taskpaper> <infile> [outfile]\n
For example: ruby taskpaper-extract.rb scrivener litreview.taskpaper litreview
(Scrivener outputs to a directory, with each tag in a separate textfile, taskpaper to a single hierarchical textfile)
@@ -97,12 +97,11 @@
end
outdir = ARGV[2]
-outdir ||= ARGV[0].remove(".taskpaper)") + ".out"
+outdir ||= ARGV[1].remove(".taskpaper") + ".out"
if ARGV[0] == 'scrivener'
- outdir = 'litreview'
- `mkdir #{outdir}`
- `rm -rf #{outdir}/*.txt`
+ `mkdir '#{outdir}'`
+ `rm -rf '#{outdir}/*.txt'`
tags.each do |tag, content|
out = ''
@@ -122,9 +121,11 @@
else #Taskpaper
outdir = outdir + ".taskpaper" unless outdir.index(".taskpaper")
+ out = ''
tags.each do |tag, content|
nockey = ''
+
out << "#{tag}:\n"
content.each do |fragments|
Please sign in to comment.
Something went wrong with that request. Please try again.