Neur0toxine
5f69051859
* New module structure (refactoring) * Simple serializer and deserializer with models, new architecture * Move logic to strategies * Partial api client facade implementation (full implementation is not necessary for now) * Loyalty feature installer * Sms verification order (#167) * Make updater self-sufficient * Fix for order submit & fix for incorrect component rendering in the constructor * Fix for loyalty personal area error handling * Fix for cart component identity * Fix for softlock when customer cannot be registered in loyalty Co-authored-by: Сергей Чазов <45812598+Chazovs@users.noreply.github.com> Co-authored-by: Sergey Chazov <oitv18@gmail.com>
47 lines
1.2 KiB
Bash
47 lines
1.2 KiB
Bash
#!/bin/bash
|
|
# $1 -- folder name to pack;
|
|
|
|
version=$1
|
|
dir=${2-$PWD}
|
|
|
|
cd $dir
|
|
|
|
date=`date +"%Y-%m-%d %H:%M:%S"`
|
|
|
|
if [ ! -d "$version/install" ]; then
|
|
mkdir -p "./$version/install"
|
|
echo "Created a folder \"install\""
|
|
fi
|
|
|
|
if [ ! -f "$version/install/version.php" ]; then
|
|
touch "./$version/install/version.php"
|
|
echo "Created a file \"version.php\""
|
|
fi
|
|
|
|
echo "
|
|
<?
|
|
\$arModuleVersion = array(
|
|
\"VERSION\" => \"$version\",
|
|
\"VERSION_DATE\" => \"$date\"
|
|
);
|
|
" > "./$version/install/version.php"
|
|
echo "Update version and date in the file \"version.php\""
|
|
|
|
for i in `find ./"$version" -type f -name '*.*'`; do
|
|
encoding=`file -b --mime-encoding "$i"`
|
|
if [ "$encoding" != "iso-8859-1" ] && [ "$encoding" != "us-ascii" ] && [ "$encoding" != "binary" ]; then
|
|
echo "$i: converting from $encoding to cp1251"
|
|
result=$(iconv -f $encoding -t "cp1251" $i -o $i.cp1251 2>&1 > /dev/null)
|
|
if [ ! -z "$result" ]; then
|
|
echo "Errors in file $i"
|
|
echo $result
|
|
exit 255
|
|
fi
|
|
mv $i.cp1251 $i
|
|
fi
|
|
done
|
|
echo "Encoding the file has changed"
|
|
|
|
tar -czf $version.tar.gz $version
|
|
echo "Update has been successfully packaged"
|