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
2 changes: 1 addition & 1 deletion commands/project/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function project:exec() {

_checkProject
# Determine the first service from docker-compose.yml
service=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//')
service=$(_yq eval '.services | keys | .[0]' docker-compose.yml)

# Check if the provided service exists
if _serviceExists "${1}"; then
Expand Down
2 changes: 1 addition & 1 deletion commands/project/exec/root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function project:exec() {

_checkProject
# Determine the first service from docker-compose.yml
service=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//')
service=$(_yq eval '.services | keys | .[0]' docker-compose.yml)

# Check if the provided service exists
if _serviceExists "${1}"; then
Expand Down
2 changes: 1 addition & 1 deletion commands/project/fix-permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function project:fix-permissions() {
_logYellow "fix-permissions not allowed with sync-mode '${SYNC_MODE}'"
fi

local container=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//')
local container=$(_yq eval '.services | keys | .[0]' docker-compose.yml)
local permission="dde:dde"
local path="/var/www"
local user=$(id -u)
Expand Down
2 changes: 1 addition & 1 deletion commands/project/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
function project:shell() {
_checkProject
_loadProjectDotdde
local service=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//')
local service=$(_yq eval '.services | keys | .[0]' docker-compose.yml)

if [[ "${1}" != "" ]]; then
if _serviceExists ${1}; then
Expand Down
2 changes: 1 addition & 1 deletion commands/project/shell/root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
function project:shell:root() {
_checkProject
_loadProjectDotdde
local service=$(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//')
local service=$(_yq eval '.services | keys | .[]' docker-compose.yml | head -n1 | sed 's/.*\.//')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| head -n1 | sed 's/.*\.//' we can do this with yq too


if [[ "${1}" != "" ]]; then
if _serviceExists ${1}; then
Expand Down