forked from ambientum/ambientum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.bash
42 lines (34 loc) · 1.12 KB
/
commands.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# where the ambientum cache will live
A_BASE=$HOME/.cache/ambientum
# define specific cache directories
A_CONFIG=$A_BASE/.config
A_CACHE=$A_BASE/.cache
A_LOCAL=$A_BASE/.local
A_SSH=$HOME/.ssh
A_COMPOSER=$A_BASE/.composer
# create directories
mkdir -p $A_CONFIG
mkdir -p $A_CACHE
mkdir -p $A_LOCAL
mkdir -p $A_COMPOSER
###########################################
#### DO NOT EDIT BELOW THIS LINE UNLESS #
#### YOU KNOW WHAT YOU'RE DOING #
###########################################
# reset permissions
chown -R $(whoami):$(whoami) $A_BASE
# home directory
A_USER_HOME=/home/ambientum
####
# Alias for NPM And other node commands
####
# Node Env
function n() {
docker run -it --rm -v $(pwd):/var/www/app -v $A_CONFIG:$A_USER_HOME/.config -v $A_CACHE:$A_USER_HOME/.cache -v $A_LOCAL:$A_USER_HOME/.local -v $A_SSH:$A_USER_HOME/.ssh ambientum/node:7 "$@"
}
alias n=n
# PHP Env
function p() {
docker run -it --rm -v $(pwd):/var/www/app -v $A_COMPOSER:$A_USER_HOME/.composer -v $A_CONFIG:$A_USER_HOME/.config -v $A_CACHE:$A_USER_HOME/.cache -v $A_LOCAL:$A_USER_HOME/.local -v $A_SSH:$A_USER_HOME/.ssh ambientum/php:7.1 "$@"
}
alias p=p