-
Notifications
You must be signed in to change notification settings - Fork 3
/
devspace-start.sh
executable file
·39 lines (33 loc) · 1.58 KB
/
devspace-start.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
#!/bin/bash
set +e # Continue on errors
COLOR_CYAN="\033[0;36m"
COLOR_RESET="\033[0m"
RUN_CMD="go run ./cmd/main.go"
DEBUG_CMD="dlv debug ./cmd/main.go --listen=0.0.0.0:2342 --api-version=2 --output /tmp/__debug_bin --headless"
echo -e "${COLOR_CYAN}
____ ____
| _ \ _____ __/ ___| _ __ __ _ ___ ___
| | | |/ _ \ \ / /\___ \| '_ \ / _\` |/ __/ _ \\
| |_| | __/\ V / ___) | |_) | (_| | (_| __/
|____/ \___| \_/ |____/| .__/ \__,_|\___\___|
|_|
${COLOR_RESET}
Welcome to your development container!
This is how you can work with it:
- Run \`${COLOR_CYAN}${RUN_CMD}${COLOR_RESET}\` to start validator
- ${COLOR_CYAN}Files will be synchronized${COLOR_RESET} between your local machine and this container
If you wish to run validator in the debug mode with delve, run:
\`${COLOR_CYAN}${DEBUG_CMD}${COLOR_RESET}\`
Wait until the \`${COLOR_CYAN}API server listening at: [::]:2342${COLOR_RESET}\` message appears
Start the \"Debug (localhost:2342)\" configuration in VSCode to connect your debugger session.
${COLOR_CYAN}Note:${COLOR_RESET} validator won't start until you connect with the debugger.
${COLOR_CYAN}Note:${COLOR_RESET} validator will be stopped once you detach your debugger session.
${COLOR_CYAN}TIP:${COLOR_RESET} hit an up arrow on your keyboard to find the commands mentioned above :)
"
# add useful commands to the history for convenience
export HISTFILE=/tmp/.bash_history
history -s $RUN_CMD
history -s $DEBUG_CMD
history -a
# hide "I have no name!" from the bash prompt
bash --init-file <(echo "export PS1=\"\\H:\\W\\$ \"")