-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3b83d8f
commit 499a167
Showing
6 changed files
with
35 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
#Remove the contents of the dist folder | ||
# Remove the contents of the dist folder | ||
rm -frd ./dist | ||
mkdir ./dist | ||
|
||
#Run the wp script that produces the zip | ||
# Ensure the vendor folder is present in the current directory | ||
if [ ! -d "./vendor" ]; then | ||
echo "Vendor folder not found. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Run the wp script that produces the zip | ||
npx wp-scripts plugin-zip | ||
|
||
# unzip the zip into its own folder so we can zip that | ||
# Unzip the zip into its own folder so we can zip that | ||
unzip enable-contributor-uploads.zip -d ./dist/enable-contributor-uploads | ||
|
||
# Check if vendor folder is present in the unzipped content | ||
if [ ! -d "./dist/enable-contributor-uploads/vendor" ]; then | ||
echo "Vendor folder is missing in the unzipped content. Adding it manually." | ||
cp -r ./vendor ./dist/enable-contributor-uploads/vendor | ||
fi | ||
|
||
# plugin-zip includes package.json which is not needed for the plugin, so remove. | ||
rm ./dist/enable-contributor-uploads/package.json | ||
rm ./dist/enable-contributor-uploads/README.md | ||
|
||
#remove the original zip | ||
# Remove the original zip | ||
rm enable-contributor-uploads.zip | ||
|
||
#move into the dist folder and zip the plugin's folder | ||
# Move into the dist folder and zip the plugin's folder | ||
cd ./dist | ||
zip -r enable-contributor-uploads.zip ./enable-contributor-uploads | ||
|
||
#cleanup and drop back into the original dir | ||
# Cleanup and drop back into the original dir | ||
rm -r ./enable-contributor-uploads | ||
cd .. |
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