Sha256: 15c2677e6c2b754cc83dd3599c72c1c1349ae74232cad6fb337a0a8ebccde7b7

Contents?: true

Size: 989 Bytes

Versions: 103

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true

module J1
  module Commands
    class Nbi < Command
      #noinspection MissingYardParamTag
      class << self

        def init_with_program(prog)
          prog.command(:nbi) do |c|
            c.description 'Run an export of all textbooks for all Juyper Notebooks available'
            c.syntax 'nbi'
            c.action do |args, options|
              J1::Commands::Nbi.process(args, options)
            end
          end
        end

        def process(args, options = {})
          timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
          if J1::Utils::is_project?
            if J1::Utils::is_project_setup?
              J1.logger.info "#{timestamp} - NBI: Exporting nbinteract textbooks ..."
              process = J1::Utils::Exec2.run('NBI','npm', 'run', 'nbi-export--all')
            else
              raise SystemExit
            end
          else
            raise SystemExit
          end
        end

      end
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
j1-template-2024.3.19 lib/j1/commands/nbi.rb
j1-template-2024.3.18 lib/j1/commands/nbi.rb
j1-template-2024.3.17 lib/j1/commands/nbi.rb
j1-template-2024.3.16 lib/j1/commands/nbi.rb
j1-template-2024.3.15 lib/j1/commands/nbi.rb
j1-template-2024.3.14 lib/j1/commands/nbi.rb
j1-template-2024.3.13 lib/j1/commands/nbi.rb
j1-template-2024.3.12 lib/j1/commands/nbi.rb
j1-template-2024.2.1 lib/j1/commands/nbi.rb
j1-template-2024.2.0 lib/j1/commands/nbi.rb
j1-template-2024.1.5 lib/j1/commands/nbi.rb
j1-template-2024.1.4 lib/j1/commands/nbi.rb
j1-template-2024.1.3 lib/j1/commands/nbi.rb
j1-template-2024.1.2 lib/j1/commands/nbi.rb
j1-template-2024.1.1 lib/j1/commands/nbi.rb
j1-template-2024.1.0 lib/j1/commands/nbi.rb
j1-template-2024.0.3 lib/j1/commands/nbi.rb
j1-template-2024.0.2 lib/j1/commands/nbi.rb
j1-template-2024.0.1 lib/j1/commands/nbi.rb
j1-template-2024.0.0 lib/j1/commands/nbi.rb