-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.sh
executable file
·54 lines (40 loc) · 1.53 KB
/
dev.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
############################## DEV_SCRIPT_MARKER ##############################
# This script is used to document and run recurring tasks in development. #
# #
# You can run your tasks using the script `./dev some-task`. #
# You can install the Sandstorm Dev Script Runner and run your tasks from any #
# nested folder using `dev some-task`. #
# https://github.com/sandstorm/Sandstorm.DevScriptRunner #
###############################################################################
set -e
######### TASKS #########
function build() {
go build main.go
mkdir -p ~/.docker/cli-plugins
rm -f ~/.docker/cli-plugins/docker-execroot
ln -s `pwd`/main ~/.docker/cli-plugins/docker-execroot
rm -f ~/.docker/cli-plugins/docker-vscode
ln -s `pwd`/main ~/.docker/cli-plugins/docker-vscode
rm -f ~/.docker/cli-plugins/docker-phpprofiler
ln -s `pwd`/main ~/.docker/cli-plugins/docker-phpprofiler
rm -f ~/.docker/cli-plugins/docker-xdebug
ln -s `pwd`/main ~/.docker/cli-plugins/docker-xdebug
_log_success "Built and linked binaries"
}
function start-netshoot() {
docker run --rm -it nicolaka/netshoot /bin/bash
}
####### Utilities #######
_log_success() {
printf "\033[0;32m%s\033[0m\n" "${1}"
}
_log_warning() {
printf "\033[1;33m%s\033[0m\n" "${1}"
}
_log_error() {
printf "\033[0;31m%s\033[0m\n" "${1}"
}
# THIS NEEDS TO BE LAST!!!
# this will run your tasks
"$@"