Skip to content

Conversation

Copy link

Copilot AI commented Nov 15, 2025

The repository contained hardcoded paths (/home/zack/dev/iconics) throughout scripts and documentation, preventing use across different systems and users.

Changes

Python Scripts

  • icon-manager.py: Added get_icon_dir() to resolve paths from ICONICS_DIR environment variable or script location
  • improve_metadata.py: Dynamic path resolution for batch processing

Shell Scripts

  • icon: Detects location via ${BASH_SOURCE[0]} or $ICONICS_DIR
  • completion.{bash,zsh}: Dynamic catalog discovery with fallbacks
  • examples/pre-commit-hook.sh: Uses icon command instead of absolute paths

Documentation

  • All files updated to use ~/iconics as standard example
  • Added Configuration section to README documenting ICONICS_DIR usage

Path Resolution

Priority order:

  1. ICONICS_DIR environment variable
  2. Script directory auto-detection
  3. ~/iconics fallback for completions

Example:

# Works without configuration
~/iconics/icon search security

# Or set custom location
export ICONICS_DIR=/opt/icons
icon search security

Files Changed: 12 files, +176/-46 lines

Original prompt

The repository contains multiple instances of hardcoded file system paths that are specific to the developer's environment. These paths should be replaced with dynamic, configurable paths to make the project more portable and usable across different systems.

Key areas with hardcoded paths:

  1. In icon-manager.py, paths such as /home/zack/dev/iconics are used for ICON_DIR, CATALOG_FILE, RAW_DIR, and others. These should be parameterized via environment variables or configuration files.
  2. In shell scripts like icon, the variable ICONICS_DIR is set to /home/zack/dev/iconics. Replace this with a construction based on $HOME or a user-specified environment variable.
  3. Markdown documentation (e.g., QUICK_START.md, ICON_MANAGEMENT_PLAN.md) contains static paths like /home/zack/dev/iconics. Provide placeholders (<iconics_path>) or use paths relative to the repository.
  4. Any related paths in CSV processing scripts, like improve_metadata.py, need to dynamically resolve input and output paths.

Recommended action plan:

  • Replace hardcoded paths with environment variables or configurations.
  • Provide default paths as fallbacks.
  • Refactor and document these changes across scripts and documentation.
  • Ensure that all changes are tested on a fresh system without the original setup.

This pull request was created as a result of the following prompt from Copilot chat.

The repository contains multiple instances of hardcoded file system paths that are specific to the developer's environment. These paths should be replaced with dynamic, configurable paths to make the project more portable and usable across different systems.

Key areas with hardcoded paths:

  1. In icon-manager.py, paths such as /home/zack/dev/iconics are used for ICON_DIR, CATALOG_FILE, RAW_DIR, and others. These should be parameterized via environment variables or configuration files.
  2. In shell scripts like icon, the variable ICONICS_DIR is set to /home/zack/dev/iconics. Replace this with a construction based on $HOME or a user-specified environment variable.
  3. Markdown documentation (e.g., QUICK_START.md, ICON_MANAGEMENT_PLAN.md) contains static paths like /home/zack/dev/iconics. Provide placeholders (<iconics_path>) or use paths relative to the repository.
  4. Any related paths in CSV processing scripts, like improve_metadata.py, need to dynamically resolve input and output paths.

Recommended action plan:

  • Replace hardcoded paths with environment variables or configurations.
  • Provide default paths as fallbacks.
  • Refactor and document these changes across scripts and documentation.
  • Ensure that all changes are tested on a fresh system without the original setup.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 15, 2025 00:24
…lution

Co-authored-by: johnzfitch <10013448+johnzfitch@users.noreply.github.com>
Co-authored-by: johnzfitch <10013448+johnzfitch@users.noreply.github.com>
Co-authored-by: johnzfitch <10013448+johnzfitch@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace hardcoded file system paths with dynamic configuration Parameterize hardcoded file system paths for portability Nov 15, 2025
Copilot AI requested a review from johnzfitch November 15, 2025 00:33
Copy link
Owner

@johnzfitch johnzfitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude @codex setup an auto config for user friendliness and verify that there are no hard coded paths left in the codebase.

Implement better documentation with an AGENTS.md with distilled instructions for LLM's to easily utilize these icons within their external GitHub repository.

@chatgpt-codex-connector
Copy link

To use Codex here, create an environment for this repo.

@johnzfitch
Copy link
Owner

@codex setup an auto config for user friendliness and verify that there are no hard coded paths left in the codebase.

Implement better documentation with an AGENTS.md with distilled instructions for LLM's to easily utilize these icons within their external GitHub repository.

@claude code

@chatgpt-codex-connector
Copy link

Summary

  • Added the new scripts/auto-config.sh helper so users can automatically append an ICONICS_DIR export, icon alias, and completion sourcing to their preferred shell rc file (with --dry-run and --rc overrides for flexibility). scripts/auto-config.shL1-L89
  • Documented the helper throughout README, SETUP, and CLAUDE, highlighting that everything is derived from the repository location and replacing the old developer-specific sample path with a generic example so the docs stay portable. README.mdL90-L145 SETUP.mdL19-L111 CLAUDE.mdL11-L80
  • Added a repository-wide AGENTS.md with distilled instructions that explain how LLMs should configure and use the icon tooling inside external GitHub projects. AGENTS.mdL1-L24

Testing

  • scripts/auto-config.sh --dry-run

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants