# --list (sensible default)
default:
	just --list

# Composer #############################################################################################################

composer *args:
    @ddev exec composer {{args}}

composer-install:
    @just composer install

composer-update *args:
    @just composer update {{args}}

composer-fix-hash:
    @just composer update --lock

# Project ##############################################################################################################

# Full project install
install:
	@git pull
	@just composer-install
	@just craft-update
	@just clear-cache

# Update craft & run migrations
craft-update:
    @ddev exec php craft up

# Clear Craft cache and update API cache
clear-cache:
	@ddev exec php craft clear-caches/all

# Full project update
update:
    @just install

# Aliases ##############################################################################################################

alias ci := composer-install
alias cu := composer-update