From fa0d4fe44eeaf3648fe26b068b4a58e44cf3959f Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 28 Feb 2026 10:16:14 +0100 Subject: feat(workstation): make ed respect .gitignore --- nixos/profiles/workstation/scripts/ed | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'nixos/profiles/workstation/scripts/ed') 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" -- cgit v1.3.1