Class: Octodown::FileChooser::MarkdownFileList::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/octodown/support/file_chooser.rb

Instance Method Summary collapse

Instance Method Details

#callObject



21
22
23
24
# File 'lib/octodown/support/file_chooser.rb', line 21

def call
  ext_args = EXTENSIONS.map { |ext| "**/*.#{ext} *.#{ext}" }.join(' ')
  `git ls-files --cached --others -z #{ext_args}`.split("\x0").uniq
end

#runnable?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'lib/octodown/support/file_chooser.rb', line 26

def runnable?
  `git rev-parse --is-inside-work-tree`
  $CHILD_STATUS.success?
rescue StandardError
  false
end