[PR #323] [MERGED] Fix project folder name starting with "-" in data #9585

Closed
opened 2026-02-16 18:13:48 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/323
Author: @furai
Created: 6/23/2025
Status: Merged
Merged: 6/23/2025
Merged by: @thdxr

Base: devHead: feature/fix-project-path-in-data


📝 Commits (1)

  • 3ce38f9 Fix project folder name starting with "-" in data

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/opencode/src/app/app.ts (+1 -1)

📄 Description

When starting new session in a project with .git folder the path created in data storage starts with a hyphen on linux. E.g.:

Actual path: /path/to/my/amazing-project
It becomes: ~/.local/share/opencode/project/-path-to-my-amazing-project

This causes issues when trying to change to that directory when one is in ~/.local/share/opencode/ as the first letter is interpreted as option passed to cd command.

This PR attempts to fix it by filtering out "falsy" values from the array before joining it with the hyphens.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/323 **Author:** [@furai](https://github.com/furai) **Created:** 6/23/2025 **Status:** ✅ Merged **Merged:** 6/23/2025 **Merged by:** [@thdxr](https://github.com/thdxr) **Base:** `dev` ← **Head:** `feature/fix-project-path-in-data` --- ### 📝 Commits (1) - [`3ce38f9`](https://github.com/anomalyco/opencode/commit/3ce38f90e98ab1cbb60e22d12388cdfebf54bd10) Fix project folder name starting with "-" in data ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/app/app.ts` (+1 -1) </details> ### 📄 Description When starting new session in a project with `.git` folder the path created in data storage starts with a hyphen on linux. E.g.: Actual path: `/path/to/my/amazing-project` It becomes: `~/.local/share/opencode/project/-path-to-my-amazing-project` This causes issues when trying to change to that directory when one is in `~/.local/share/opencode/` as the first letter is interpreted as option passed to cd command. This PR attempts to fix it by filtering out "falsy" values from the array before joining it with the hyphens. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:48 -05:00
yindo closed this issue 2026-02-16 18:13:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9585