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
17 changes: 2 additions & 15 deletions bin/_command_wrapper_run
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
bin_path="`dirname $0`"
root_dir="$( cd $bin_path && cd .. && pwd)"
relative_path=${PWD#$root_dir}
user_uid=1000
user_group=1000

if [[ "$OSTYPE" == "darwin"* ]]; then
user_uid=501
user_group=20
fi

# Load project specific variables.
set -o allexport
Expand All @@ -24,14 +17,8 @@ shift;
container=$PROJECT_NAME
container+="_$container_name"

# If the input comes from a pipe or file ("< something.txt") we cant use "t"
#flag since it will fail with "the input device is not a TTY"
# -t 0 == stdin
if [ -t 0 ]; then
tty="-it"
else
tty="-i"
fi
## MOVE TO FOLDER where docker-compose yml files are located
cd ${root_dir}

command="docker-compose run --rm node /bin/bash -c 'cd /var/www/html$relative_path && $@'"

Expand Down
21 changes: 20 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#!/usr/bin/env bash

###Define available downloader

exists()
{
command -v "$1" >/dev/null 2>&1
}

if exists curl; then
echo 'We are using curl to fetch the files !'
downloader="curl -L "
elif exists wget; then
echo 'We are using wget to fetch the files !'
downloader="wget -O - "
else
echo 'Your system does not have Wget nor Curl available.'
echo 'You need to provide one of them for this installer to work'
exit
fi

rm -rf /tmp/dockerizer

echo "Installing dockerizer"
Expand All @@ -14,7 +33,7 @@ echo -e "Installing smartcd"

# Install smartcd if not installed.
if [ ! -f "$HOME/.smartcd_config" ]; then
curl -L http://smartcd.org/install | bash
$downloader http://smartcd.org/install | bash
else
echo -e "\e[32mCurrently installed\e[0m"
fi
Expand Down