From 1792926dfde2cfd9d8b9f47a11543fb154e2a4e0 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Tue, 25 Jul 2023 10:27:26 -0700 Subject: [PATCH] Add date to JMdict file name --- data/.gitignore | 2 +- data/fetch.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/.gitignore b/data/.gitignore index 224e4a5..c674722 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1 +1 @@ -JMdict.xml +JMdict*.xml diff --git a/data/fetch.sh b/data/fetch.sh index 108f41c..d8ab9f7 100755 --- a/data/fetch.sh +++ b/data/fetch.sh @@ -6,5 +6,10 @@ wget http://ftp.edrdg.org/pub/Nihongo/JMdict.gz # Extract and delete archive gzip -d JMdict.gz +# Get date +date=`grep -m 1 -oE '' JMdict.xml | sed -E 's//\1/'` + +rm JMdict*.xml + # Add XML extension -mv JMdict JMdict.xml +mv JMdict JMdict-${date}.xml