Skip to content

Commit

Permalink
Fixed to work on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dejwCake committed Jun 17, 2019
1 parent 5162b79 commit 7bb793b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions code-style-fixer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

VERSION=1.0.0
VERSION=1.0.2

function main {
if [[ -f .env ]]; then
Expand Down Expand Up @@ -75,10 +75,23 @@ function getPhp {
command -v docker >/dev/null 2>&1
if [[ $? -eq 0 ]] && [[ ${GIT_HOOKS_IGNORE_DOCKER} != true ]]; then
export DOCKER_PHP_VERSION=${DOCKER_PHP_VERSION:-7.2}
ENV=""

# check system
UNAMEOUT="$(uname -s)"
case "${UNAMEOUT}" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=mac;;
*) MACHINE="UNKNOWN"
esac
if [[ "$MACHINE" == linux ]]; then
ENV="-e HARBOR_USER_UID=${UID}"
fi

if [[ $1 == t ]]; then
DOCKER="docker run -it --rm -v "${PWD}":/var/www/html:delegated -v "${PWD}/docker/php/ssh":/root/.ssh:delegated brackets/php:"${DOCKER_PHP_VERSION}
DOCKER="docker run -it --rm -v "${PWD}":/var/www/html:delegated -v "${PWD}/docker/php/ssh":/root/.ssh:delegated ${ENV} brackets/php:"${DOCKER_PHP_VERSION}
else
DOCKER="docker run --rm -v "${PWD}":/var/www/html:delegated -v "${PWD}/docker/php/ssh":/root/.ssh:delegated brackets/php:"${DOCKER_PHP_VERSION}
DOCKER="docker run --rm -v "${PWD}":/var/www/html:delegated -v "${PWD}/docker/php/ssh":/root/.ssh:delegated ${ENV} brackets/php:"${DOCKER_PHP_VERSION}
fi
PHP=${DOCKER}
fi
Expand Down

0 comments on commit 7bb793b

Please sign in to comment.