Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

fix Copy Over "cannot stat" error #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions split2flac
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ REPLAY_GAIN=0
FORMAT="${0##*split2}"
DIR="."
OUTPATTERN="@artist/{@year - }@album/@track - @title.@ext"
COPYMASKS="[Cc]overs \*.log \*.txt \*.jpg \*.cbr"
COPYMASKS="[Cc]overs *.log *.txt *.jpg *.cbr"
COPYFILES=1
ENCA_ARGS=""

Expand Down Expand Up @@ -480,7 +480,11 @@ split_file () {
PATTERN=$(update_pattern "${PATTERN}" "ext" "${FORMAT}")

# construct output directory name
OUT="${DIR}"
if [ $(echo "$DIR" | cut -c 1) == "/" ] ; then
OUT="${DIR}"
else
OUT="$(pwd)/$DIR"
fi

if [ ${NOSUBDIRS} -eq 0 ]; then
# add path from the pattern
Expand Down Expand Up @@ -680,11 +684,11 @@ split_file () {
eval "for i in ${COPYMASKS}; do \
test -r \"\$i\" && \
echo \" +> \$i\" 2>/dev/null; done"
cd "${old}"
if [ ${DRY} -ne 1 ]; then
eval "for i in ${COPYMASKS}; do \
test -r/\"${SDIR}/\$i\" && \
cp -r \"${SDIR}/\$i\" \"\${OUT}/\"; done"
test -r \"\$i\" && \
cp -r \"\$i\" \"\${OUT}/\"; done"
cd "${old}"
fi
fi

Expand Down