-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
161 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
"package-lock.json", | ||
"webpack.config.js", | ||
".editorconfig", | ||
".svnignore" | ||
".svnignore", | ||
"bin", | ||
"build" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit if any command fails. | ||
set -e | ||
|
||
# Change to the expected directory. | ||
cd "$(dirname "$0")" | ||
cd .. | ||
DIR=$(pwd) | ||
BUILD_DIR="$DIR/build/wepos" | ||
|
||
# Enable nicer messaging for build status. | ||
BLUE_BOLD='\033[1;34m'; | ||
GREEN_BOLD='\033[1;32m'; | ||
RED_BOLD='\033[1;31m'; | ||
YELLOW_BOLD='\033[1;33m'; | ||
COLOR_RESET='\033[0m'; | ||
error () { | ||
echo -e "\n${RED_BOLD}$1${COLOR_RESET}\n" | ||
} | ||
status () { | ||
echo -e "\n${BLUE_BOLD}$1${COLOR_RESET}\n" | ||
} | ||
success () { | ||
echo -e "\n${GREEN_BOLD}$1${COLOR_RESET}\n" | ||
} | ||
warning () { | ||
echo -e "\n${YELLOW_BOLD}$1${COLOR_RESET}\n" | ||
} | ||
|
||
status "💃 Time to build the wePOS Pro ZIP file 🕺" | ||
|
||
# remove the build directory if exists and create one | ||
rm -rf "$DIR/build" | ||
mkdir -p "$BUILD_DIR" | ||
|
||
# Run the build. | ||
# status "Installing dependencies... 📦" | ||
# npm install | ||
|
||
status "Generating build... 👷♀️" | ||
npm run dev-build | ||
npm run build | ||
|
||
# Copy all files | ||
status "Copying files... ✌️" | ||
FILES=(wepos.php readme.txt assets includes languages templates composer.json composer.lock) | ||
|
||
for file in ${FILES[@]}; do | ||
cp -R $file $BUILD_DIR | ||
done | ||
|
||
# Delete the source JS directory | ||
rm -rf "$BUILD_DIR/assets/src" | ||
rm -rf "$BUILD_DIR/assets/less" | ||
|
||
# Install composer dependencies | ||
status "Installing dependencies... 📦" | ||
cd $BUILD_DIR | ||
composer install --optimize-autoloader --no-dev -q | ||
|
||
# Remove composer files | ||
rm composer.json composer.lock | ||
|
||
# go one up, to the build dir | ||
status "Creating archive... 🎁" | ||
cd .. | ||
zip -r -q wepos.zip wepos | ||
|
||
# remove the source directory | ||
rm -rf wepos | ||
|
||
success "Done. You've built wePOS! 🎉 " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters