Skip to content

Commit

Permalink
Release v1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
allrude authored Dec 13, 2023
1 parent a6272c3 commit d73562e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 54 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.18.0] - 2023-12-13
### Added
- new command to set theme or config

### Removed
- Scoped Valet php

## [1.17.1] - 2023-11-27
### Fixed
- Scoped Valet php, this now has no effect if your using the newest version
Expand Down
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,34 @@ curl -O https://raw.githubusercontent.com/GrimLink/mage/main/mage && chmod +x ma

## Commands

| CMD | Description |
| ---------------- | --------------------------------------------------------------------------- |
| help | Show all options |
| self-update | Update mage |
| info | Show minimal store info (e.g. version and uri) |
| stores | Show all stores _\*1_ |
| open | Open the default store, in the browser |
| open admin | Open store admin, in the browser |
| open _STOREVIEW_ | Open specific storeview, in the browser _\*1_ |
| config | Set configs for dev env |
| | [`--cache`/`-c`] Disable any frontend caches |
| | [`--admin-session`/`-a`] Set admin session to a day and no password updates |
| | [`--disable-security`/`-s`] Disable any captcha and 2fa options |
| | [`--dev-mode`/`-d`] Set all settings for local development |
| watch | Run cache-clean.js from mageTV |
| purge | Purge all static assets and caches |
| new admin | Create new admin user _\*2_ |
| new customer | Create new customer _\*1_ |
| new theme | Create new theme _\*2_ |
| new module | Create new module _\*2_ |
| new i18n | Create new translations |
| add sample | Add sample data |
| add hyva | Add Hyvä Theme _\*3_ |
| add checkout | Add Hyvä Checkout _\*3_ |
| composer | Run composer (Usefull for valet php) |
| install \| i | Run composer install or require |
| update \| up | Run composer update |
| remove \| rm | Run composer remove |
| build | Run `setup:static-content:deploy` with common defaults |
| run | Run magerun2 _\*1_ |
| CMD | Description |
| -------------------- | ------------------------------------------------------ |
| help | Show all options |
| self-update | Update mage |
| info | Show minimal store info (e.g. version and uri) |
| stores | Show all stores _\*1_ |
| open | Open the default store, in the browser |
| open admin | Open store admin, in the browser |
| open _STOREVIEW_ | Open specific storeview, in the browser _\*1_ |
| watch | Run cache-clean.js from mageTV |
| purge | Purge all static assets and caches |
| new admin | Create new admin user _\*2_ |
| new customer | Create new customer _\*1_ |
| new theme | Create new theme _\*2_ |
| new module | Create new module _\*2_ |
| new i18n | Create new translations |
| add sample | Add sample data |
| add hyva | Add Hyvä Theme _\*3_ |
| add checkout | Add Hyvä Checkout _\*3_ |
| config \| set config | Set Magento Configs |
| set hyva | Set hyva default theme _\*4_ |
| set theme | Set theme _\*4_ |
| composer | Run composer (Usefull for valet php) |
| install \| i | Run composer install or require |
| update \| up | Run composer update |
| remove \| rm | Run composer remove |
| build | Run `setup:static-content:deploy` with common defaults |
| run | Run magerun2 _\*1_ |

Any other command will run the same as `bin/magento`

Expand All @@ -74,6 +72,8 @@ Any other command will run the same as `bin/magento`
> _\*2_ add the flag `--yes` or `-y`, for using on yes all questions
>
> _\*3_ requires [Hyvä license](https://www.hyva.io/hyva-themes-license.html) or gitlab access
>
> _\*4_ requires [Yireo_ThemeCommands](https://github.com/yireo/Yireo_ThemeCommands)
## Supported platforms/environments

Expand Down
55 changes: 31 additions & 24 deletions mage
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RED='\033[0;31m'
GREEN='\033[1;32m'
BLUE='\033[1;34m'

VERSION="1.17.1"
VERSION="1.18.0"
GITNAME="$(git config --global --get user.name | head -n1 | cut -d " " -f1)"
GITEMAIL="$(git config --global --get user.email)"
ADMINNAME="$(echo "$GITNAME" | tr '[:upper:]' '[:lower:]')"
Expand Down Expand Up @@ -42,16 +42,6 @@ elif command -v n98-magerun2 &>/dev/null; then
MAGERUN_CLI="n98-magerun2"
fi

# Laravel Valet scoped PHP support
if command -v valet &> /dev/null; then
if command -v valet php &> /dev/null; then
VALET=1
MAGENTO_CLI="valet php bin/magento"
COMPOSER_CLI="valet php $(which composer)"
MAGERUN_CLI="valet php $(which magerun2)"
fi
fi

# Warden Support
if [ -f .env ] && grep -q "WARDEN_ENV_NAME" .env && [[ ! "$PATH" == /var/www/html* ]]; then
WARDEN=1
Expand Down Expand Up @@ -217,11 +207,6 @@ case "${@}" in
echo -e "- ${BLUE}self-update${RESET} (Update mage)"
echo -e "- ${BLUE}stores${RESET} (Show all stores)"
echo -e "- ${BLUE}open${RESET} (Open store in browser)"
echo -e "- ${BLUE}config${RESET} (Set configs for dev env)"
echo -e " - [${BLUE}--cache${RESET}/${BLUE}-c${RESET}] Disable any frontend caches"
echo -e " - [${BLUE}--admin-session${RESET}/${BLUE}-a${RESET}] Set admin session to a day and no password updates"
echo -e " - [${BLUE}--disable-security${RESET}/${BLUE}-s${RESET}] Disable any captcha and 2fa options"
echo -e " - [${BLUE}--dev-mode${RESET}/${BLUE}-d${RESET}] Set all settings for local development"
echo -e "- ${BLUE}watch${RESET} (Run cache-clean.js from mageTV)"
echo -e "- ${BLUE}purge${RESET} (Purge all static assets)"
echo -e "- ${BLUE}new admin${RESET} (Create new admin user)"
Expand All @@ -232,6 +217,9 @@ case "${@}" in
echo -e "- ${BLUE}add sample${RESET} (Add sample data)"
echo -e "- ${BLUE}add hyva${RESET} (Add Hyva Theme)"
echo -e "- ${BLUE}add checkout${RESET} (Add Hyva Checkout)"
echo -e "- ${BLUE}config | set config${RESET} (Set Magento Configs)"
echo -e "- ${BLUE}set hyva${RESET} (Set hyva default theme)"
echo -e "- ${BLUE}set theme${RESET} (Set theme)"
echo -e "- ${BLUE}composer${RESET} (Run composer, Usefull for valet php)"
echo -e "- ${BLUE}install | i${RESET} (Run composer install or require)"
echo -e "- ${BLUE}update | up${RESET} (Run composer update)"
Expand Down Expand Up @@ -298,14 +286,6 @@ case "${@}" in
fi
;;

"config")
mage_config
;;

"config "*)
mage_config ${@:2}
;;

"watch")
CACHE_CLI="echo cache-clean not installed ( https://github.com/mage2tv/magento-cache-clean ) 'composer global require mage2tv/magento-cache-clean'"
if command -v vendor/bin/cache-clean.js &> /dev/null; then
Expand Down Expand Up @@ -523,6 +503,33 @@ case "${@}" in
echo -e "\n${RED}No ${BOLD}add${RESET}${RED} option given!${RESET}" && help_message
;;

"set theme"*)
$MAGENTO_CLI theme:change $3
$MAGENTO_CLI cache:flush;
;;

"set hyva")
$MAGENTO_CLI theme:change Hyva/default
$MAGENTO_CLI cache:flush
;;

"set baldr")
$MAGENTO_CLI theme:change Siteation/baldr
$MAGENTO_CLI cache:flush
;;

"config" | "set config")
mage_config
;;

"config "* | "set config "*)
mage_config ${@:2}
;;

"set"*)
echo -e "\n${RED}No ${BOLD}set${RESET}${RED} option given!${RESET}" && help_message
;;

"composer"*)
$COMPOSER_CLI ${@:2}
;;
Expand Down

0 comments on commit d73562e

Please sign in to comment.