From 5e5c0e3ca050b59bd025903e4f5920f364657114 Mon Sep 17 00:00:00 2001 From: Na-x4 Date: Tue, 2 Nov 2021 18:08:11 +0900 Subject: [PATCH] add extract-aqtk.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AquesTalk の規約に沿って展開するシェルスクリプトを作った --- .dockerignore | 1 + .gitignore | 2 +- Dockerfile | 6 ++---- extract-aqtk.sh | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100755 extract-aqtk.sh diff --git a/.dockerignore b/.dockerignore index 9547169..bd682be 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .git target +aquestalk diff --git a/.gitignore b/.gitignore index 9ca56c2..d871af9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -/app +/aquestalk diff --git a/Dockerfile b/Dockerfile index cafd832..a659ae0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,12 +41,10 @@ WORKDIR /home/user COPY --chown=user:user / /home/user/aquestalk-proxy RUN cd aquestalk-proxy \ && cargo build --release \ - && unzip aqtk_mv_20090609.zip \ && mkdir app && cd app \ && mv ../target/i686-pc-windows-gnu/release/aquestalk-proxy.exe ./aquestalk-proxy.exe \ - && mv ../AquesTalk_mv/bin ./aquestalk\ - && find ./aquestalk/ -mindepth 1 -maxdepth 1 -type d -exec cp ../AquesTalk_mv/AqLicense.txt {} \; \ - && rm -rf ../AquesTalk_mv \ + && ../extract-aqtk.sh \ + && mv ../aquestalk ./aquestalk \ && cp ../README.md ./ \ && cp ../COPYING ./ diff --git a/extract-aqtk.sh b/extract-aqtk.sh new file mode 100755 index 0000000..f1569f6 --- /dev/null +++ b/extract-aqtk.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -eux +cd "$(dirname "$0")" + +if [ -e aquestalk ]; then + exit 1 +fi + +TMPDIR=$(mktemp -d) + +unzip -d "$TMPDIR" aqtk_mv_20090609.zip +mv "$TMPDIR"/AquesTalk_mv/bin ./aquestalk +find ./aquestalk/ -mindepth 1 -maxdepth 1 -type d -exec cp "$TMPDIR"/AquesTalk_mv/AqLicense.txt {} \; +rm -rf "$TMPDIR"