-
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.
Merge branch 'develop', version 0.1.0
- Loading branch information
Showing
23 changed files
with
2,872 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# The zip file generated by build-zip.sh | ||
moodle-mod-gharar.zip | ||
|
||
/vendor/ |
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,48 @@ | ||
#!/bin/sh | ||
|
||
# Config | ||
# Create a temporary directory to prevent conflictions | ||
tmpDirname=".tmp" | ||
pluginName="gharar" | ||
outputFilename="moodle-mod-gharar.zip" | ||
|
||
# Exit on error | ||
set -e | ||
|
||
mainRepoDir="$(dirname "$(realpath "$0")")/.." | ||
tmpDir="$mainRepoDir/../$tmpDirname" | ||
|
||
# The resulting file path | ||
zipFilePath="$mainRepoDir/$outputFilename" | ||
|
||
# Remove dev dependencies from vendor/ directory. Otherwise, the resulting file | ||
# will be huge in size. For example, 80KB versus 17MB for the directory alone. | ||
# At last, we will revert this change back. | ||
echo "Removing Composer dev dependencies..." | ||
composer --no-dev install > /dev/null 2>&1 | ||
|
||
mkdir -p "$tmpDir" | ||
cd "$tmpDir" | ||
|
||
# Make sure the resulting file includes only one directory matching plugin's name | ||
rsync -av "$mainRepoDir/" "./$pluginName" \ | ||
--exclude ".git" --exclude ".gitignore" --exclude "bin/" \ | ||
--exclude "$outputFilename" > /dev/null | ||
|
||
# Remove previous zip file to prevent extra removed files to remain there | ||
if [[ -e "$zipFilePath" ]]; then | ||
rm "$zipFilePath" | ||
fi | ||
|
||
# Create the zip file in the current directory | ||
zip -r -y "$zipFilePath" "./$pluginName" > /dev/null | ||
|
||
# Cleanup | ||
cd "$mainRepoDir" | ||
rm -r "$tmpDir" | ||
|
||
echo "Zip file created successfully." | ||
|
||
cd "$mainRepoDir" | ||
echo "Re-adding Composer dev dependencies..." | ||
composer install > /dev/null 2>&1 |
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,26 @@ | ||
{ | ||
"name": "machitgarha/moodle-mod-gharar", | ||
"description": "Gharar plugin for Moodle", | ||
"type": "library", | ||
"license": "GPLv3", | ||
"authors": [ | ||
{ | ||
"name": "Mohammad Amin Chitgarha", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/machitgarha", | ||
"role": "Creator" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.2" | ||
}, | ||
"require-dev": { | ||
"vimeo/psalm": "^4.9", | ||
"machitgarha/bimoo": "^3.11.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MAChitgarha\\MoodleModGharar\\": "src" | ||
} | ||
} | ||
} |
Oops, something went wrong.