Skip to content

Commit

Permalink
Download Mosaico JS files via composer-downloads-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed May 27, 2022
1 parent 4c8248b commit d24e6c3
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 23 deletions.
20 changes: 0 additions & 20 deletions bin/setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -e

DEFAULT_MOSAICO_BRANCH="v0.15-civicrm-2"
DEFAULT_MOSAICO_REPO="https://github.com/civicrm/mosaico"
EXTROOT=$(cd `dirname $0`/..; pwd)
EXTKEY="uk.co.vedaconsulting.mosaico"
XMLBUILD="$EXTROOT/build/xml/schema"
Expand Down Expand Up @@ -83,24 +81,6 @@ function do_gencode() {

##############################
function do_download() {
if [ ! -d "$EXTROOT/packages" ]; then
mkdir "$EXTROOT/packages"
fi
if [ ! -d "$EXTROOT/packages/mosaico" ]; then
git clone -b "$DEFAULT_MOSAICO_BRANCH" "$DEFAULT_MOSAICO_REPO" "$EXTROOT/packages/mosaico"
fi
pushd "$EXTROOT/packages/mosaico" >> /dev/null
local currentBranch=$(basename /$(git symbolic-ref HEAD 2>/dev/null))
if [ "$currentBranch" != "$DEFAULT_MOSAICO_BRANCH" ]; then
echo "Error: packages/mosaico is not on expected branch ($DEFAULT_MOSAICO_BRANCH). You may either:"
echo " (1) Checkout the branch '$DEFAULT_MOSAICO_BRANCH'. Then run 'setup.sh -D' again."
echo " (2) Manage the branch manualy. Be sure to call 'npm install' and 'grunt' as needed."
exit 1
fi
npm install
find node_modules -name '*.info' -delete
grunt build
popd >> /dev/null
pushd "$EXTROOT" >> /dev/null
composer install
popd >> /dev/null
Expand Down
18 changes: 17 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"name": "civipkg/uk.co.vedaconsulting.mosaico",
"require": {
"intervention/image": "^2.4"
"intervention/image": "^2.4",
"civicrm/composer-downloads-plugin": "^3.0"
},
"replace": {
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/psr7": "^1.8.5"
},
"config": {
"allow-plugins": {
"civicrm/composer-downloads-plugin": true
}
},
"extra": {
"downloads": {
"mosaico": {
"version": "v0.15-civicrm-2.1",
"path": "packages/mosaico",
"url": "https://github.com/civicrm/mosaico/releases/download/{$version}/mosaico-dist.tar.gz"
}
}
}
}
95 changes: 93 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d24e6c3

Please sign in to comment.