Sha256: 898fed59c9352ab3e1d9d69712701004d789bc49b5dd7d725f9a98ee47fb77df

Contents?: true

Size: 593 Bytes

Versions: 6

Compression:

Stored size: 593 Bytes

Contents

#!/usr/bin/env ruby

ADB = ENV['ADB'] || 'adb'

unless ::File.executable? ADB
  warn %(adb-push-ebook: `adb` not found.\nPlease set the ADB environment variable or add `adb` to your PATH.)
  exit 1
end

require 'open3'
require 'shellwords'

docname = ARGV[0] || '_output/sample-book'

targets = {
  'epub' => '/sdcard/',
  'mobi' => '/sdcard/Android/data/com.amazon.kindle/files/'
}

targets.each {|(ext, target)|
  file = %(#{docname}.#{ext})
  Open3.popen2e(Shellwords.join [ADB, 'push', file, target]) {|input, output, wait_thr|
    output.each {|line| puts line }
  } if File.file? file
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
asciidoctor-epub3-1.5.0.alpha.6 bin/adb-push-ebook
asciidoctor-epub3-1.5.0.alpha.5 bin/adb-push-ebook
asciidoctor-epub3-1.5.0.alpha.4 bin/adb-push-ebook
asciidoctor-epub3-1.0.0.alpha.3 bin/adb-push-ebook
asciidoctor-epub3-1.0.0.alpha.2 bin/adb-push-ebook
asciidoctor-epub3-1.0.0.alpha.1 bin/adb-push-ebook