Skip to content

Fix gomi_dir being ignored when strategy is auto#113

Merged
babarot merged 1 commit intomainfrom
babarot/fix-gomi-dir-ignored-with-auto-strategy
Mar 20, 2026
Merged

Fix gomi_dir being ignored when strategy is auto#113
babarot merged 1 commit intomainfrom
babarot/fix-gomi-dir-ignored-with-auto-strategy

Conversation

@babarot
Copy link
Copy Markdown
Owner

@babarot babarot commented Mar 20, 2026

Summary

Fix a bug where gomi_dir config is silently ignored when strategy is set to auto (the default).

Background

Reported in Issue #100. When a user sets gomi_dir to a custom path (e.g. /mnt/.Trash-1000/gomi), they expect files to be trashed there. However, with strategy: auto, XDG storage is initialized first and takes priority β€” it ignores gomi_dir entirely since it's a legacy-only setting. Files end up in the XDG trash location (e.g. /mnt/.Trash/files) instead of the configured directory.

The user's intent is clear: setting gomi_dir means they want legacy storage behavior.

Changes

  • cli/cli.go: When gomi_dir is set and strategy is auto, automatically switch to legacy strategy before initializing storage backends
  • README.md: Update gomi_dir documentation to clarify the auto-switching behavior

Closes #100

Automatically switch to legacy storage when gomi_dir is explicitly
set and strategy is auto, since gomi_dir only applies to legacy mode.

Closes #100
@github-actions
Copy link
Copy Markdown
Contributor

Code Metrics Report

main (7c07e4c) #113 (a4e9934) +/-
Coverage 50.0% 50.0% 0.0%
Code to Test Ratio 1:0.8 1:0.8 0.0
Test Execution Time 2s 3s +1s
Details
  |                     | main (7c07e4c) | #113 (a4e9934) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          50.0% |          50.0% | 0.0% |
  |   Files             |             23 |             23 |    0 |
  |   Lines             |           1087 |           1087 |    0 |
  |   Covered           |            544 |            544 |    0 |
  | Code to Test Ratio  |          1:0.8 |          1:0.8 |  0.0 |
  |   Code              |           2713 |           2713 |    0 |
  |   Test              |           2321 |           2321 |    0 |
- | Test Execution Time |             2s |             3s |  +1s |

Reported by octocov

@babarot babarot mentioned this pull request Mar 20, 2026
@babarot babarot added the kind/improvement An improvement to existing functionality; not a new feature or bug fix label Mar 20, 2026
@babarot babarot marked this pull request as ready for review March 20, 2026 09:51
@babarot babarot merged commit e6bface into main Mar 20, 2026
5 checks passed
@babarot babarot deleted the babarot/fix-gomi-dir-ignored-with-auto-strategy branch March 20, 2026 09:51
@github-actions github-actions bot mentioned this pull request Mar 20, 2026
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 25, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [babarot/gomi](https://github.com/babarot/gomi) | patch | `v1.6.2` β†’ `v1.6.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>babarot/gomi (babarot/gomi)</summary>

### [`v1.6.3`](https://github.com/babarot/gomi/blob/HEAD/CHANGELOG.md#v163---2026-03-20)

[Compare Source](babarot/gomi@v1.6.2...v1.6.3)

##### Bug fixes

- Fix files with dollar signs in names being incorrectly expanded by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;111](babarot/gomi#111)
- Fix cross-device link error in legacy storage by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;112](babarot/gomi#112)

##### Improvements

- Fix empty files being excluded from restore list by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;110](babarot/gomi#110)
- Fix gomi\_dir being ignored when strategy is auto by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;113](babarot/gomi#113)
- Fix colors invisible on light terminal backgrounds by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;114](babarot/gomi#114)

</details>

---

### Configuration

πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

β™» **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

πŸ”• **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44Ny4xIiwidXBkYXRlZEluVmVyIjoiNDMuODcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement An improvement to existing functionality; not a new feature or bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gomi_dir not work

1 participant