Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,13 @@ Completely tear down and remove one or more Composer projects:
lec remove # Choose one or more projects to remove
```

List various entities

```sh
lec list # Displays entities that can be listed; `lec list <entity>` lists all entries of the selected entity.
lec list releases # Displays all releases.
```

Jump to a workspace:

```sh
Expand Down
57 changes: 29 additions & 28 deletions scripts/cli/lec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ _printHelpAndExit() {
stop Stop a Composer project
clean Stop a Composer project and remove Docker volumes
exportData Export container data for a Composer project
list List entities of a various types
remove Completely tear down and remove one or more Composer projects
share [--export] Save a Composer workspace for sharing. The "--export" flag exports the container data before saving the workspace.
update [--unstable] Check for updates to Composer and lec. The "--unstable" flag updates to latest master branch.
Expand Down Expand Up @@ -533,34 +534,6 @@ _cmd_gw() {
./gradlew "${@}"
)
}
_cmd_list() {
local closest_entity
local entity="${1}"

if [[ -z "${entity}" ]]; then
_print_step "Showing listable entities..."

_listPrefixedFunctions _list_

exit
fi

if ! _verifyListableEntity "${entity}"; then
closest_entity=$(_listPrefixedFunctions _list_| _fzf --filter "${entity}" | head -n 1)

if _verifyListableEntity "${closest_entity}" && _confirm "Entity \"${entity}\" is unknown. Use closest entity \"${closest_entity}\" instead?"; then
entity=${closest_entity}
else
_print_error "Cannot list ${C_YELLOW}${entity}${C_NC}. Showing listable entities..."

_listPrefixedFunctions _list_

exit
fi
fi

_list_"${entity}"
}
_cmd_ports() {
local serviceName="${1}"

Expand Down Expand Up @@ -721,6 +694,34 @@ cmd_init() {

_print_success "Created new Liferay Environment Composer project at ${C_BLUE}${worktree_dir}${C_NC}"
}
cmd_list() {
local closest_entity
local entity="${1}"

if [[ -z "${entity}" ]]; then
_print_step "Showing listable entities..."

_listPrefixedFunctions _list_

exit
fi

if ! _verifyListableEntity "${entity}"; then
closest_entity=$(_listPrefixedFunctions _list_| _fzf --filter "${entity}" | head -n 1)

if _verifyListableEntity "${closest_entity}" && _confirm "Entity \"${entity}\" is unknown. Use closest entity \"${closest_entity}\" instead?"; then
entity=${closest_entity}
else
_print_error "Cannot list ${C_YELLOW}${entity}${C_NC}. Showing listable entities..."

_listPrefixedFunctions _list_

exit
fi
fi

_list_"${entity}"
}
cmd_remove() {
local worktrees
worktrees="$(_listWorktrees | grep -E -v "^${LIFERAY_ENVIRONMENT_COMPOSER_HOME}$" | _selectMultiple "Choose projects to remove (Tab to select multiple)")"
Expand Down