Sha256: f7a85742fefedee3fe647b20b3017c5e84119ab8aaa98e73aaa8ab6cfb15d083
Contents?: true
Size: 1.38 KB
Versions: 66
Compression:
Stored size: 1.38 KB
Contents
# frozen_string_literal: true module J1 module Commands class Reset < Command #noinspection MissingYardParamTag class << self def init_with_program(prog) prog.command(:reset) do |c| c.description 'Reset a J1 Project to factory state' c.syntax 'reset' c.action do |args, options| J1::Commands::Reset.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} - RESET: Reset the project to factory state ..." J1.logger.info "#{timestamp} - RESET: Be patient, this will take a while ..." process = J1::Utils::Exec2.run('RESET','npm', 'run', 'reset') if process.success? timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S") J1.logger.info "#{timestamp} - RESET: The project reset finished successfully." J1.logger.info "#{timestamp} - RESET: To setup the project, run: j1 setup" else raise SystemExit end else raise SystemExit end else raise SystemExit end end end end end end
Version data entries
66 entries across 66 versions & 1 rubygems