Skip to content

Commit

Permalink
shell(composer): add new composer action and commit functions
Browse files Browse the repository at this point in the history
  • Loading branch information
codepuncher committed Sep 18, 2024
1 parent d90f60c commit 2061465
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions shell/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,44 @@ alias cg='c global'
alias cgrm='cg remove'
alias cgr='cg require'
alias cgu='cg update'
crc() {
PACKAGE="${1}"
if [ -z "${PACKAGE}" ]; then
echo 'No package provided'
return 1
fi

if ! [[ "${PACKAGE}" =~ (.*)\/(.*) ]]; then
echo "${PACKAGE} does not match vendor/package syntax"
return 1
fi

MESSAGE="cr ${PACKAGE}"
if [ -n "${2}" ]; then
MESSAGE="${2}"
fi

cr "${PACKAGE}" && ga composer.* && gc -m "${MESSAGE}"
}
crmc() {
PACKAGE="${1}"
if [ -z "${PACKAGE}" ]; then
echo 'No package provided'
return 1
fi

if ! [[ "${PACKAGE}" =~ (.*)\/(.*) ]]; then
echo "${PACKAGE} does not match vendor/package syntax"
return 1
fi

MESSAGE="crm ${PACKAGE}"
if [ -n "${2}" ]; then
MESSAGE="${2}"
fi

crm "${PACKAGE}" && ga composer.* && gc -m "${MESSAGE}"
}

# Node
alias y='yarn'
Expand Down

0 comments on commit 2061465

Please sign in to comment.