Skip to content

Commit

Permalink
Merge pull request #25 from sai-gillingham/4.1.1-4.1.2
Browse files Browse the repository at this point in the history
4.1.1-4.1.2-p1のプラグイン更新。
  • Loading branch information
chihiro-adachi authored Sep 16, 2022
2 parents 2368920 + 3640e2c commit 8694381
Show file tree
Hide file tree
Showing 8 changed files with 2,714 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Common/Constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
class Constant
{
const FROM_VERSION = '4.1.1';
const TO_VERSION = '4.1.2';
const TO_VERSION = '4.1.2-p1';
const PLUGIN_CODE = 'EccubeUpdater411to412';
}
1,304 changes: 1,297 additions & 7 deletions Resource/file_hash/file_hash.yaml

Large diffs are not rendered by default.

1,304 changes: 1,297 additions & 7 deletions Resource/file_hash/file_hash_crlf.yaml

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion Resource/template/admin/config.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@
<div class="row">
<div class="col mb-2">
EC-CUBE 4.1.2 の変更点は<a target="_blank" rel="noreferrer noopener"
href="https://github.com/EC-CUBE/ec-cube/releases/tag/4.1.2">こちら</a>をご覧ください。
href="https://github.com/EC-CUBE/ec-cube/releases/tag/4.1.2">こちら</a>をご覧ください。
</div>
</div>
<div class="row">
<div class="col mb-2">
EC-CUBE 4.1.2-p1 の変更点は<a target="_blank" rel="noreferrer noopener"
href="https://github.com/EC-CUBE/ec-cube/releases/tag/4.1.2-p1">こちら</a>をご覧ください。
</div>
</div>
</div>
Expand Down
Binary file modified Resource/update_file.tar.gz
Binary file not shown.
106 changes: 98 additions & 8 deletions bin/replace_version.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,117 @@
#!/usr/bin/env bash

NEXT_VERSION=406
NEXT_VERSION=412
PARTIAL_PREVIOUS_VERSION=
PARTIAL_CURRENT_VERSION=
PARTIAL_NEXT_VERSION=

OVERRIDE_CURRENT_FROM=411
OVERRIDE_CURRENT_TO=412
OVERRIDE_CURRENT_FROM_STR=4.1.1
OVERRIDE_CURRENT_TO_STR=4.1.2-p1

NEXT_FROM=$((NEXT_VERSION - 1))
NEXT_TO=$NEXT_VERSION

NEXT_FROM_STR=${NEXT_FROM:0:1}.${NEXT_FROM:1:1}.${NEXT_FROM:2:2}
NEXT_TO_STR=${NEXT_TO:0:1}.${NEXT_TO:1:1}.${NEXT_TO:2:2}

CURRENT_FROM=$((NEXT_VERSION - 2))
CURRENT_TO=$((NEXT_VERSION - 1))

CURRENT_FROM_STR=${CURRENT_FROM:0:1}.${CURRENT_FROM:1:1}.${CURRENT_FROM:2:2}
CURRENT_TO_STR=${CURRENT_TO:0:1}.${CURRENT_TO:1:1}.${CURRENT_TO:2:2}
if [ -z "${PARTIAL_CURRENT_VERSION}" ]; then
NEXT_FROM_STR=${NEXT_FROM:0:1}.${NEXT_FROM:1:1}.${NEXT_FROM:2:2}
else
CURRENT_FROM=$((CURRENT_FROM+2))
NEXT_FROM=${NEXT_VERSION}${PARTIAL_CURRENT_VERSION}
NEXT_FROM_STR=${NEXT_VERSION:0:1}.${NEXT_VERSION:1:1}.${NEXT_VERSION:2:2}${PARTIAL_CURRENT_VERSION}
fi

if [ -z "${PARTIAL_NEXT_VERSION}" ]; then
NEXT_TO_STR=${NEXT_TO:0:1}.${NEXT_TO:1:1}.${NEXT_TO:2:2}
else
NEXT_TO=${NEXT_VERSION}${PARTIAL_NEXT_VERSION}
NEXT_TO_STR=${NEXT_VERSION:0:1}.${NEXT_VERSION:1:1}.${NEXT_VERSION:2:2}${PARTIAL_NEXT_VERSION}
fi

if [ -z "${PARTIAL_PREVIOUS_VERSION}" ]; then
CURRENT_FROM_STR=${CURRENT_FROM:0:1}.${CURRENT_FROM:1:1}.${CURRENT_FROM:2:2}
else
CURRENT_FROM=${NEXT_VERSION}${PARTIAL_PREVIOUS_VERSION}
CURRENT_FROM_STR=${NEXT_VERSION:0:1}.${NEXT_VERSION:1:1}.${NEXT_VERSION:2:2}${PARTIAL_PREVIOUS_VERSION}
fi
if [ -z "${PARTIAL_CURRENT_VERSION}" ]; then
CURRENT_TO_STR=${CURRENT_TO:0:1}.${CURRENT_TO:1:1}.${CURRENT_TO:2:2}
else
CURRENT_TO=${NEXT_VERSION}${PARTIAL_CURRENT_VERSION}
CURRENT_TO_STR=${NEXT_VERSION:0:1}.${NEXT_VERSION:1:1}.${NEXT_VERSION:2:2}${PARTIAL_CURRENT_VERSION}
fi

if [ -z "${OVERRIDE_CURRENT_FROM}" ]; then
true
else
CURRENT_FROM=${OVERRIDE_CURRENT_FROM}
fi

if [ -z "${OVERRIDE_CURRENT_TO}" ]; then
true
else
CURRENT_TO=${OVERRIDE_CURRENT_TO}
fi

files=`find . -type f -name '*.php' -or -name '*.twig'`
if [ -z "${OVERRIDE_CURRENT_FROM_STR}" ]; then
true
else
CURRENT_FROM_STR=${OVERRIDE_CURRENT_FROM_STR}
fi

if [ -z "${OVERRIDE_CURRENT_TO_STR}" ]; then
true
else
CURRENT_TO_STR=${OVERRIDE_CURRENT_TO_STR}
fi

echo "NEXT_FROM_STR=${NEXT_FROM_STR}"
echo "NEXT_TO_STR=${NEXT_TO_STR}"
echo "CURRENT_FROM_STR=${CURRENT_FROM_STR}"
echo "CURRENT_TO_STR=${CURRENT_TO_STR}"
echo "NEXT_FROM=${NEXT_FROM}"
echo "NEXT_TO=${NEXT_TO}"
echo "CURRENT_FROM=${CURRENT_FROM}"
echo "CURRENT_TO=${CURRENT_TO}"
echo "NEXT_VERSION=${NEXT_VERSION}"
echo "PARTIAL_PREVIOUS_VERSION=${PARTIAL_PREVIOUS_VERSION}"
echo "PARTIAL_CURRENT_VERSION=${PARTIAL_CURRENT_VERSION}"
echo "PARTIAL_NEXT_VERSION=${PARTIAL_NEXT_VERSION}"

files=`find . -type f -name '*.php' -or -name '*.twig' -or -name 'services.yaml'`

for file in $files; do
# MACOS専用コマンド
if [ "$(uname)" == "Darwin" ]; then
sed -i '' "s/EccubeUpdater${CURRENT_FROM}to${CURRENT_TO}/EccubeUpdater${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i '' "s/eccube_updater${CURRENT_FROM}to${CURRENT_TO}/eccube_updater${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i '' "s/eccube_updater_${CURRENT_FROM}_to_${CURRENT_TO}/eccube_updater_${NEXT_FROM}_to_${NEXT_TO}/g" $file
sed -i '' "s/${CURRENT_TO_STR}/${NEXT_TO_STR}/g" $file
sed -i '' "s/${CURRENT_FROM_STR}/${NEXT_FROM_STR}/g" $file
sed -i '' "s/:update${CURRENT_FROM}to${CURRENT_TO}/:update${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i '' "s/eccube_update_plugin_${CURRENT_FROM}_${CURRENT_TO}_php_path/eccube_update_plugin_${NEXT_FROM}_${NEXT_TO}_php_path/g" $file
# LINUX専用コマンド
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sed -i "s/EccubeUpdater${CURRENT_FROM}to${CURRENT_TO}/EccubeUpdater${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i "s/eccube_updater${CURRENT_FROM}to${CURRENT_TO}/eccube_updater${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i "s/eccube_updater_${CURRENT_FROM}_to_${CURRENT_TO}/eccube_updater_${NEXT_FROM}_to_${NEXT_TO}/g" $file
sed -i "s/${CURRENT_TO_STR}/${NEXT_TO_STR}/g" $file
sed -i "s/${CURRENT_FROM_STR}/${NEXT_FROM_STR}/g" $file
sed -i "s/:update${CURRENT_FROM}to${CURRENT_TO}/:update${NEXT_FROM}to${NEXT_TO}/g" $file
sed -i "s/eccube_update_plugin_${CURRENT_FROM}_${CURRENT_TO}_php_path/eccube_update_plugin_${NEXT_FROM}_${NEXT_TO}_php_path/g" $file
fi
done

sed -i '' "s/EccubeUpdater${CURRENT_FROM}to${CURRENT_TO}/EccubeUpdater${NEXT_FROM}to${NEXT_TO}/g" composer.json
# MACOS専用コマンド
if [ "$(uname)" == "Darwin" ]; then
sed -i '' "s/EccubeUpdater${CURRENT_FROM}to${CURRENT_TO}/EccubeUpdater${NEXT_FROM}to${NEXT_TO}/g" composer.json
sed -i '' "s/eccubeupdater${CURRENT_FROM}to${CURRENT_TO}/eccubeupdater${NEXT_FROM}to${NEXT_TO}/g" composer.json
# LINUX専用コマンド
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sed -i "s/EccubeUpdater${CURRENT_FROM}to${CURRENT_TO}/EccubeUpdater${NEXT_FROM}to${NEXT_TO}/g" composer.json
sed -i "s/eccubeupdater${CURRENT_FROM}to${CURRENT_TO}/eccubeupdater${NEXT_FROM}to${NEXT_TO}/g" composer.json
fi

18 changes: 13 additions & 5 deletions bin/update_file_hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -x

BASE_DIR=$(pwd)
WORK_DIR=${BASE_DIR}/work
FROM=4.0.6-p1
TO=4.1.0
FROM=4.1.1
TO=4.1.2-p1

# 差分チェックの対象外ファイルの一覧
# ここで指定したファイルは, プラグインの差分チェック時の対象外になります
Expand Down Expand Up @@ -83,9 +83,17 @@ do

if [ -f $file ]
then
md5 $file | sed -e "s/MD5 (//" -e "s/) = /: /" >> ${BASE_DIR}/Resource/file_hash/file_hash.yaml
perl -p -i -e 's/\n/\r\n/g' $file
md5 $file | sed -e "s/MD5 (//" -e "s/) = /: /" >> ${BASE_DIR}/Resource/file_hash/file_hash_crlf.yaml
# MACOS専用コマンド
if [ "$(uname)" == "Darwin" ]; then
md5 $file | sed -e "s/MD5 (//" -e "s/) = /: /" >> ${BASE_DIR}/Resource/file_hash/file_hash.yaml
perl -p -i -e 's/\n/\r\n/g' $file
md5 $file | sed -e "s/MD5 (//" -e "s/) = /: /" >> ${BASE_DIR}/Resource/file_hash/file_hash_crlf.yaml
# LINUX専用コマンド
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
md5sum $file | awk '{ print $2":", $1}' >> ${BASE_DIR}/Resource/file_hash/file_hash.yaml
perl -p -i -e 's/\n/\r\n/g' $file
md5sum $file | awk '{ print $2":", $1}' >> ${BASE_DIR}/Resource/file_hash/file_hash_crlf.yaml
fi
fi
done < ${WORK_DIR}/update_files.txt

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ec-cube/eccubeupdater411to412",
"version": "1.0.0",
"version": "1.0.1",
"description": "EC-CUBEアップデートプラグイン",
"type": "eccube-plugin",
"require": {
Expand Down

0 comments on commit 8694381

Please sign in to comment.