Skip to content

Add DISPATCH_CONFIG env var to override the config file path #295

Description

@jongio

Problem

The config file path is fixed at the OS config directory (%APPDATA%\dispatch on Windows, ~/.config/dispatch on Linux, ~/Library/Application Support/dispatch on macOS). There is no way to point dispatch at a different config file. That makes it hard to keep separate profiles (for example work and personal launch defaults) or to run a throwaway config for testing.

Proposed solution

Honor a DISPATCH_CONFIG environment variable that names an absolute path to the config file. When set, Load, Save, config path, and doctor all use that path instead of the default. When unset, behavior is unchanged. This matches the KUBECONFIG style of config path override.

For safety, reject a relative path and a UNC path (the same rule already used for the log file), falling back to the default when the value is unusable.

Acceptance criteria

  • With DISPATCH_CONFIG set to an absolute path, dispatch config path prints that path and config get/set/edit read and write it.
  • dispatch doctor reports the overridden config path.
  • An unset DISPATCH_CONFIG keeps the current default path behavior.
  • A relative or UNC DISPATCH_CONFIG value is ignored and the default path is used.
  • README documents the variable and the resolution order.
  • Tests cover set, unset, and the rejected-path cases.

Complexity

S

Priority

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestideaFeature idea from the idea pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions