diff options
| author | Martin Fischer <martin@push-f.com> | 2026-02-28 10:16:14 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-02-28 10:17:26 +0100 |
| commit | fa0d4fe44eeaf3648fe26b068b4a58e44cf3959f (patch) | |
| tree | 1757e4c93ecf340d00e996e260a794683c22a9bf /nixos | |
| parent | 7b8f5f6931ffe92ddeacc1e66e85aa3684c5118e (diff) | |
feat(workstation): make ed respect .gitignore
Diffstat (limited to 'nixos')
| -rwxr-xr-x | nixos/profiles/workstation/scripts/ed | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/profiles/workstation/scripts/ed b/nixos/profiles/workstation/scripts/ed index bed7d79..e6c23d3 100755 --- a/nixos/profiles/workstation/scripts/ed +++ b/nixos/profiles/workstation/scripts/ed @@ -1,3 +1,12 @@ #!/usr/bin/env bash -files=$(find . -not -path "*/.*" | sk --no-info "$@") || exit + +list_files() { + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git -c core.quotePath=false ls-files --cached --others --exclude-standard + else + find . -type f -not -path "*/.*" + fi +} + +files=$(list_files | sk --no-info "$@") || exit $VISUAL "$files" |
