Skip to content

Add ability to set mount destination#2

Open
karilaa-dev wants to merge 1 commit intomainfrom
change-base-mount
Open

Add ability to set mount destination#2
karilaa-dev wants to merge 1 commit intomainfrom
change-base-mount

Conversation

@karilaa-dev
Copy link
Copy Markdown
Owner

@karilaa-dev karilaa-dev commented Jan 7, 2026

Summary

  • Adds a new SDMOUNTDIR configuration parameter that allows users to customize the mount destination folder name (defaults to Cloud)
  • Replaces hardcoded Cloud references with the configurable SDMOUNTDIR variable throughout the service script
  • Removes redundant BINDPOINT_* and SD_BINDPOINT variables in favor of inline path construction

Test plan

  • Verify default behavior still mounts to /sdcard/Cloud/<remote>
  • Test custom SDMOUNTDIR value in global config mounts to /sdcard/<custom>/<remote>
  • Verify unmount functionality works correctly with custom mount directories

Summary by CodeRabbit

  • Refactor
    • Made mount directory configuration more flexible through a new configurable parameter (previously hardcoded).
    • Updated all path references and mount operations to consistently use the new parameter across legacy and modern systems.
    • Updated informational output to reflect the new path structure.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

Introduced a new public mount directory constant SDMOUNTDIR with value "Cloud" and refactored the script to replace hard-coded "Cloud" path references with this constant throughout bind/unbind operations and Android filesystem path constructions.

Changes

Cohort / File(s) Summary
Mount directory constant refactoring
service.sh
Added SDMOUNTDIR constant; replaced hard-coded "Cloud" references in bind/unbind operations, path construction for Android runtime/data-media paths, and informational output echoes; updated parameter initialization logic to include SDMOUNTDIR in global parameter handling

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A constant's born, no longer scattered,
Through Cloud paths where strings had chattered,
SDMOUNTDIR now leads the way,
Making code cleaner every day! ☁️✨

Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately reflects the main change: introducing a new SDMOUNTDIR parameter that allows users to configure where mount destinations are created, replacing hardcoded Cloud paths.

✏️ Tip: You can configure your own custom Pre-merge Checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14d7e9a and 6930e19.

📒 Files selected for processing (1)
  • service.sh
🧰 Additional context used
🪛 Shellcheck (0.11.0)
service.sh

[warning] 151-151: In POSIX sh, [[ ]] is undefined.

(SC3010)


[warning] 155-155: In POSIX sh, [[ ]] is undefined.

(SC3010)

🔇 Additional comments (4)
service.sh (4)

68-68: LGTM! Correct parameter scope.

The addition of SDMOUNTDIR to the global parameters list is correct. By excluding it from per-remote parameters (line 70), the design ensures that all remotes share the same mount directory structure, which is appropriate for this use case.


115-123: LGTM! Consistent path updates.

The replacement of hardcoded "Cloud" with ${SDMOUNTDIR} in the unbind paths is correct and consistent across all runtime paths (default, read, write) and the Android 11+ data_media path.


148-171: LGTM! Complete and consistent implementation.

All path constructions in the sd_binder function have been correctly updated to use ${SDMOUNTDIR}:

  • Directory creation and ownership (lines 148-149)
  • Bind mount points for all Android versions and runtime paths (lines 153, 157, 160, 165)
  • User-facing output message (line 171)

The implementation is complete and maintains consistency with the sd_unbind function changes.


14-14: LGTM! Code changes are consistent.

The new SDMOUNTDIR variable correctly provides configurability while maintaining backward compatibility with the default "Cloud" value. The variable is properly included in the PARAMS array, ensuring it's handled consistently in both custom_params() and reset_params() functions. All hardcoded "Cloud" path references have been successfully replaced with $SDMOUNTDIR.

No issues identified with the current implementation.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant