Skip to content

Replace hardcoded Windows paths with portable relative paths#2

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-root-directory-support
Draft

Replace hardcoded Windows paths with portable relative paths#2
Copilot wants to merge 2 commits into
mainfrom
copilot/add-root-directory-support

Conversation

Copilot AI commented Jan 3, 2026

Copy link
Copy Markdown

Two Python scripts contained hardcoded Windows drive paths (x:\FPGA\Project\embedfire_FPGA_ks), breaking portability across systems and directory structures.

Changes

  • read_docs.py: Use os.path.dirname(os.path.abspath(__file__)) instead of hardcoded x:\FPGA\Project\...
  • find_pins.py: Use script-relative path resolution instead of absolute Windows path

Both scripts now dynamically resolve file paths relative to their own location:

# Before
base_path = r"x:\FPGA\Project\embedfire_FPGA_ks"
pdf_file = os.path.join(base_path, "[野火]征途Pro_开发板规格书.pdf")

# After
base_path = os.path.dirname(os.path.abspath(__file__))
pdf_file = os.path.join(base_path, "[野火]征途Pro_开发板规格书.pdf")

Scripts now work from any clone location on any OS.

Original prompt

C盘


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Aixgeekx

Aixgeekx commented Jan 3, 2026 via email

Copy link
Copy Markdown
Owner

Co-authored-by: Philosopher0X <143936113+Philosopher0X@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for root directory commands Replace hardcoded Windows paths with portable relative paths Jan 3, 2026
Copilot AI requested a review from Aixgeekx January 3, 2026 10:45
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