charmbracelet / soft-serve

The mighty, self-hostable Git server for the command line🍦
MIT License
5.2k stars 132 forks source link

fix: executable path in hooks #459

Closed wahjava closed 7 months ago

wahjava commented 8 months ago

On platforms, where soft-serve executable gets installed in a path that is not the same throughout installation, or upgrades, hooks break. Some examples of such a situation is when moving soft-serve repositories from one OS to another OS, or on NixOS (NixOS/nixpkgs#272128)

This commit passes the path to the current executable as an environment variable $SOFT_SERVE_EXE_PATH to the hooks.

To fix/update existing repository hooks:

[/path/to/soft-serve/repos] $ grep -ERl \ '^[^[:space:]]+soft-serve[^[:space:]]+' . | xargs sed -r -e \ 's,^([^[:space:]]soft-serve[^[:space:]]),"${SOFT_SERVE_EXE_PATH}",g' -i

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3d02df4) 56.42% compared to head (f266be8) 56.44%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #459 +/- ## ========================================== + Coverage 56.42% 56.44% +0.02% ========================================== Files 157 157 Lines 13454 13454 ========================================== + Hits 7591 7594 +3 + Misses 5256 5254 -2 + Partials 607 606 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

wahjava commented 8 months ago

Thanks for the review, updated with the credits.