From b5ce62b39d96dec7026ee0bbad7e921239342e65 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Tue, 10 Dec 2019 04:36:55 +0500 Subject: [PATCH] Fix find command on linux system --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index abd3e66..d823757 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ path = ~/.shellrc/bin/scripts +find := $(shell { command -v gfind || command -v find; } 2>&-) all: install @@ -9,10 +10,10 @@ rmdir: rmdir $(path) 2>&-; : install: mkdir - gfind . -maxdepth 1 -type f -executable -exec basename {} \; | while read -r line; do ln -s $$(realpath $$line) $(path)/$$line 2>&-; done; true + $(find) . -maxdepth 1 -type f -executable -exec basename {} \; | while read -r line; do ln -s $$(realpath -- $$line) $(path)/$$line 2>&-; done; true rmlinks: - gfind . -maxdepth 1 -type f -executable -exec basename {} \; | xargs -IF rm -fv $(path)/F + $(find) . -maxdepth 1 -type f -executable -exec basename {} \; | xargs -IF rm -fv $(path)/F uninstall: rmlinks rmdir