-
Notifications
You must be signed in to change notification settings - Fork 0
feat: install modules #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I get this error ChatGPT says this, and suggests this fix: #!/bin/bash
set -e
# if "--local" is passed, use local path for modules
# otherwise, use VCS repository
if [ "$1" == "--local" ]; then
local=true
fi
add_vcs_repo() {
echo "Adding VCS repository: $1"
repo_url=$1
type="vcs"
if [ "$local" == true ]; then
module_name=$(basename "$repo_url")
repo_url="../$module_name"
type="path"
fi
# Ensure repositories key exists in composer.json
jq 'if .repositories == null then .repositories = [] else . end' composer.json > composer.json.tmp
mv composer.json.tmp composer.json
# Only add repo if not already present
if ! jq -e --arg url "$repo_url" '.repositories[]? | select(.url == $url)' composer.json > /dev/null; then
cp composer.json composer.json.tmp
jq --arg url "$repo_url" --arg type "$type" \
'.repositories += [{"type":$type,"url":$url}]' composer.json.tmp > composer.json
rm -f composer.json.tmp
fi
}
modules=("monicahq/marketingsite-module")
for module in "${modules[@]}"; do
add_vcs_repo "https://github.com/$module"
done
for module in "${modules[@]}"; do
echo "Installing module: $module"
composer require "$module:@dev"
done
# Ensure Modules directory exists and is actually a directory
if [ -e Modules ] && [ ! -d Modules ]; then
echo "Removing file/symlink named 'Modules'..."
rm -rf Modules
fi
if [ ! -d Modules ]; then
echo "Creating Modules directory..."
mkdir Modules
fi
# Enable modules (ignore hidden files like .DS_Store)
for module in $(ls Modules | grep -v '^\.' ); do
echo "Enabling module: $module"
php artisan module:enable "$module"
doneHowever, I'm not sure this fixes issues. I don't really get what we are trying to in this script. |
|
|
I've changed several things @asbiin
I'm unsure if you wanted also to include the new repo in compose.json ( |
|
Yeah, also now, the tests do not work anymore 😅 |



No description provided.