From ff5d24b4873cf860a19e492c9681ace9efa6eb69 Mon Sep 17 00:00:00 2001 From: Constantine Karnaukhov Date: Sat, 27 Oct 2018 00:00:30 +0400 Subject: [PATCH] refactor(bundle_mp): some improvements for iconv --- bin/bundle | 2 +- bin/bundle_mp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/bundle b/bin/bundle index 544c042..ad0600e 100755 --- a/bin/bundle +++ b/bin/bundle @@ -9,4 +9,4 @@ if [ -e .bmfignore ]; then ignore="-X .bmfignore" fi -tar -czf $name ./* $ignore +tar $ignore -czf $name ./* diff --git a/bin/bundle_mp b/bin/bundle_mp index 8373ace..6f322fb 100755 --- a/bin/bundle_mp +++ b/bin/bundle_mp @@ -8,14 +8,19 @@ cp -r ./* .last_version chown -R 1000.1000 .last_version # Convert encoding for lang files -find ./.last_version -name "*.php" -path "*lang*" -exec iconv -f utf-8 -t windows-1251 {} -o {} \; +find ./.last_version -name "*.php" -path "*lang*" | while read i; +do + echo $i + iconv -f utf-8 -t windows-1251 "$i" > tmp; \ + mv tmp "$i"; +done if [ -e .bmfignore ]; then ignore="-X .bmfignore" fi # Create bundle -tar -czf .last_version.tar.gz .last_version $ignore +tar $ignore -czf .last_version.tar.gz .last_version # Little clean up rm -rf .last_version