Permalink
Browse files

fixes pager detection when it's a pipe

  • Loading branch information...
ttscoff committed Jan 3, 2018
1 parent dd409d9 commit babb4c333b53ea77aa9c584165bb58d548f151c1
Showing with 45 additions and 28 deletions.
  1. +37 −24 Gemfile.lock
  2. +1 −1 README.md
  3. +6 −2 lib/mdless/converter.rb
  4. +1 −1 lib/mdless/version.rb
@@ -1,41 +1,51 @@
PATH
remote: .
specs:
mdless (0.0.9)
mdless (0.0.10)
GEM
remote: https://rubygems.org/
specs:
aruba (0.6.2)
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
builder (3.2.2)
childprocess (0.5.6)
aruba (0.14.3)
childprocess (~> 0.8.0)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
backports (3.11.0)
builder (3.2.3)
childprocess (0.8.0)
ffi (~> 1.0, >= 1.0.11)
cucumber (2.0.0)
contracts (0.16.0)
cucumber (3.1.0)
builder (>= 2.1.2)
cucumber-core (~> 1.1.3)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12)
cucumber-core (~> 3.1.0)
cucumber-expressions (~> 5.0.4)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 5.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.1.3)
gherkin (~> 2.12.0)
diff-lcs (1.2.5)
ffi (1.9.8)
gherkin (2.12.2)
multi_json (~> 1.3)
json (1.8.2)
multi_json (1.11.0)
cucumber-core (3.1.0)
backports (>= 3.8.0)
cucumber-tag_expressions (~> 1.1.0)
gherkin (>= 5.0.0)
cucumber-expressions (5.0.7)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
diff-lcs (1.3)
ffi (1.9.18)
gherkin (5.0.0)
multi_json (1.12.2)
multi_test (0.1.2)
rake (0.9.6)
rdoc (4.1.1)
json (~> 1.4)
rspec-expectations (3.2.1)
rdoc (4.3.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
thor (0.20.0)
PLATFORMS
ruby
@@ -45,3 +55,6 @@ DEPENDENCIES
mdless!
rake (~> 0)
rdoc (~> 4.1, >= 4.1.1)
BUNDLED WITH
1.15.4
@@ -30,8 +30,8 @@ I often use iTerm2 in visor mode, so `qlmanage -p` is annoying. I still wanted a
The pager used is determined by system configuration in this order of preference:
* `$GIT_PAGER`
* `$PAGER`
* `$GIT_PAGER`
* `git config --get-all core.pager`
* `less`
* `more`
@@ -730,12 +730,16 @@ def printout
end
def which_pager
pagers = [ENV['GIT_PAGER'], ENV['PAGER'],
pagers = [ENV['GIT_PAGER'],ENV['PAGER'],
`git config --get-all core.pager`.split.first,
'less', 'more', 'cat', 'pager']
pagers.select! do |f|
if f
system "which #{f} &> /dev/null"
if f.strip =~ /[ |]/
f
else
system "which #{f} &> /dev/null"
end
else
false
end
@@ -1,3 +1,3 @@
module CLIMarkdown
VERSION = '0.0.9'
VERSION = '0.0.10'
end

0 comments on commit babb4c3

Please sign in to comment.