mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -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 nounset
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
|
FINDTYPE="-xtype"
|
||||||
|
|
||||||
|
if [ `uname` == 'Darwin' ] ; then
|
||||||
|
# MacOS specifics
|
||||||
|
FINDTYPE="-type"
|
||||||
|
fi
|
||||||
|
|
||||||
function prerequisites {
|
function prerequisites {
|
||||||
if which zsh > /dev/null 2>&1 ; then
|
if which zsh > /dev/null 2>&1 ; then
|
||||||
if [[ $- == *i* ]] ; then
|
if [[ $- == *i* ]] ; then
|
||||||
@@ -30,7 +37,7 @@ function install_dotfile_dir {
|
|||||||
-name install.sh -o \
|
-name install.sh -o \
|
||||||
-name README.md -o \
|
-name README.md -o \
|
||||||
-name .gitignore \) \
|
-name .gitignore \) \
|
||||||
-prune -o -xtype f -print | \
|
-prune -o ${FINDTYPE} f -print | \
|
||||||
while read dotfile ; do
|
while read dotfile ; do
|
||||||
local TARGET="${HOME}/.${dotfile#${SRCDIR}/}"
|
local TARGET="${HOME}/.${dotfile#${SRCDIR}/}"
|
||||||
mkdir -p `dirname "${TARGET}"`
|
mkdir -p `dirname "${TARGET}"`
|
||||||
@@ -42,7 +49,7 @@ function install_basic_dir {
|
|||||||
local SRCDIR="${1}"
|
local SRCDIR="${1}"
|
||||||
local DESTDIR="${2}"
|
local DESTDIR="${2}"
|
||||||
local file
|
local file
|
||||||
find "${SRCDIR}" -xtype f -print | \
|
find "${SRCDIR}" ${FINDTYPE} f -print | \
|
||||||
while read file ; do
|
while read file ; do
|
||||||
local TARGET="${2}/${file#${SRCDIR}/}"
|
local TARGET="${2}/${file#${SRCDIR}/}"
|
||||||
mkdir -p `dirname "${TARGET}"`
|
mkdir -p `dirname "${TARGET}"`
|
||||||
|
|||||||
Reference in New Issue
Block a user