Class: Factorix::CLI::Commands::Path

Inherits:
Base
  • Object
show all
Defined in:
lib/factorix/cli/commands/path.rb

Overview

Display Factorio and Factorix paths

This command outputs all paths managed by the runtime environment.

Examples:

$ factorix path
executable_path     /path/to/factorio
user_dir            /path/to/user
...

Instance Method Summary collapse

Methods inherited from Base

backup_support!, confirmable!, inherited, require_game_stopped!

Instance Method Details

#call(json:) ⇒ void

This method returns an undefined value.

Execute the path command

Parameters:

  • json (Boolean)

    output in JSON format



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/factorix/cli/commands/path.rb', line 58

def call(json:, **)
  logger.debug("Displaying all paths")

  result = PATH_TYPES.transform_values {|method_name| runtime.public_send(method_name).to_s }

  if json
    out.puts JSON.pretty_generate(result)
  else
    output_table(result)
  end
end