File tree Expand file tree Collapse file tree 2 files changed +42
-12
lines changed
Expand file tree Collapse file tree 2 files changed +42
-12
lines changed Original file line number Diff line number Diff line change @@ -575,18 +575,33 @@ esac
575575find -- " ${tmpDir} /.w3m" -type f -exec sh -c " ${shellScript} " ' sh' " ${pass} " ' {}' ' +'
576576
577577for value in ' bin:destBin' ' .w3m:destW3m' ' .w3mplus:destW3mplus' ; do
578- eval " distDir =\"\$ {${value##*: } }\" "
578+ eval " destDir =\"\$ {${value##*: } }\" "
579579
580- case " ${distDir } " in
580+ case " ${destDir } " in
581581 ?* )
582582 (
583583 case " ${silentFlag} " in
584- ' 0' ) printf " '%s' を '%s' にインストール中...\\ n" " ${value%%:* } " " ${distDir } " >&2 ;;
584+ ' 0' ) printf " '%s' を '%s' にインストール中...\\ n" " ${value%%:* } " " ${destDir } " >&2 ;;
585585 esac
586586
587- mkdir -p -- " ${distDir} "
588- cd -- " ${tmpDir} /${value%%:* } "
589- find -- . -path ' ./*' -prune -exec cp -fR -- ' {}' " ${distDir} " ' ;'
587+ if [ ' !' -e " ${destDir} " ]; then
588+ mkdir -p -- " ${destDir} "
589+
590+ rm -fr " ${destDir} "
591+
592+ cp -R -- ' .' " ${destDir} "
593+ elif [ -d " ${destDir} " ]; then
594+ mkdir -p -- " ${destDir} "
595+
596+ find -- " ${tmpDir} /${value%%:* } /" -path ' *[!/]' -prune -exec cp -fR -- ' {}' " ${destDir} " ' ;'
597+ else
598+ cat << -EOF >&2
599+ ${0##*/ } : '${destDir} ' はディレクトリではありません。
600+ 詳細については '${0##*/ } --help' を実行してください。
601+ EOF
602+
603+ endCall " ${EX_DATAERR} "
604+ fi
590605 )
591606 ;;
592607 esac
Original file line number Diff line number Diff line change @@ -120,18 +120,33 @@ esac
120120find -- " ${tmpDir} /.w3m" -type f -exec sh -c " ${shellScript} " ' sh' " ${pass} " ' {}' ' +'
121121
122122for value in ' bin:destBin' ' .w3m:destW3m' ' .w3mplus:destW3mplus' ; do
123- eval " distDir =\"\$ {${value##*: } }\" "
123+ eval " destDir =\"\$ {${value##*: } }\" "
124124
125- case " ${distDir } " in
125+ case " ${destDir } " in
126126 ?* )
127127 (
128128 case " ${silentFlag} " in
129- ' 0' ) printf " '%s' を '%s' にインストール中...\\ n" " ${value%%:* } " " ${distDir } " >&2 ;;
129+ ' 0' ) printf " '%s' を '%s' にインストール中...\\ n" " ${value%%:* } " " ${destDir } " >&2 ;;
130130 esac
131131
132- mkdir -p -- " ${distDir} "
133- cd -- " ${tmpDir} /${value%%:* } "
134- find -- . -path ' ./*' -prune -exec cp -fR -- ' {}' " ${distDir} " ' ;'
132+ if [ ' !' -e " ${destDir} " ]; then
133+ mkdir -p -- " ${destDir} "
134+
135+ rm -fr " ${destDir} "
136+
137+ cp -R -- ' .' " ${destDir} "
138+ elif [ -d " ${destDir} " ]; then
139+ mkdir -p -- " ${destDir} "
140+
141+ find -- " ${tmpDir} /${value%%:* } /" -path ' *[!/]' -prune -exec cp -fR -- ' {}' " ${destDir} " ' ;'
142+ else
143+ cat << -EOF >&2
144+ ${0##*/ } : '${destDir} ' はディレクトリではありません。
145+ 詳細については '${0##*/ } --help' を実行してください。
146+ EOF
147+
148+ endCall " ${EX_DATAERR} "
149+ fi
135150 )
136151 ;;
137152 esac
You can’t perform that action at this time.
0 commit comments