mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -07:00
Nasty hack to fix find on MacOS.
This commit is contained in:
11
install.sh
11
install.sh
@@ -3,6 +3,13 @@
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
FINDTYPE="-xtype"
|
||||
|
||||
if [ `uname` == 'Darwin' ] ; then
|
||||
# MacOS specifics
|
||||
FINDTYPE="-type"
|
||||
fi
|
||||
|
||||
function prerequisites {
|
||||
if which zsh > /dev/null 2>&1 ; then
|
||||
if [[ $- == *i* ]] ; then
|
||||
@@ -30,7 +37,7 @@ function install_dotfile_dir {
|
||||
-name install.sh -o \
|
||||
-name README.md -o \
|
||||
-name .gitignore \) \
|
||||
-prune -o -xtype f -print | \
|
||||
-prune -o ${FINDTYPE} f -print | \
|
||||
while read dotfile ; do
|
||||
local TARGET="${HOME}/.${dotfile#${SRCDIR}/}"
|
||||
mkdir -p `dirname "${TARGET}"`
|
||||
@@ -42,7 +49,7 @@ function install_basic_dir {
|
||||
local SRCDIR="${1}"
|
||||
local DESTDIR="${2}"
|
||||
local file
|
||||
find "${SRCDIR}" -xtype f -print | \
|
||||
find "${SRCDIR}" ${FINDTYPE} f -print | \
|
||||
while read file ; do
|
||||
local TARGET="${2}/${file#${SRCDIR}/}"
|
||||
mkdir -p `dirname "${TARGET}"`
|
||||
|
||||
Reference in New Issue
Block a user