Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenient changes to helper functions #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
15 changes: 10 additions & 5 deletions bin/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ function renderCommands() {
echo -e "${ORANGE}Available commands for localhost environment:${NC}"
echo -e " ${GREEN}start${NC} Start and setup development environment."
echo -e " ${GREEN}stop${NC} Stop development environment."
echo -e " ${GREEN}in${NC} Go into a container."
echo -e " ${GREEN}in${NC} Go into a container as current user."
echo -e " ${GREEN}indef${NC} Go into a container as default user."
echo ""
exit 0;
}


function start() {
docker-compose up -d --build;
echo "== All done, happy coding. ==";
docker-compose up --build;
}


Expand All @@ -29,6 +29,11 @@ function stop() {
}


function goIntoContainer() {
docker exec -t -i ${APP_CONTAINER} bash;
function goIntoContainerCurrentUser() {
docker exec -t -i -u `id -u $UID` ${APP_CONTAINER} bash;
}


function goIntoContainerDefaultUser() {
docker exec -t -i ${APP_CONTAINER} bash;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Missing new line on end of file. When you add next changes then will be deleted (from view of Git) line with }.

5 changes: 4 additions & 1 deletion bin/helper
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ case "$1" in
;;

in)
goIntoContainer;
goIntoContainerCurrentUser;
;;

indef)
goIntoContainerDefaultUser;
;;
*)
echo "Sorry, I don't know want you want"
esac