some more detailed info on how to use the scripts for development

This commit is contained in:
l0k18
2023-06-20 09:26:06 +01:00
parent 55f806c9f4
commit adae9504cd
9 changed files with 52 additions and 9 deletions

View File

@@ -1,4 +0,0 @@
#!/usr/bin/zsh
cd /home/loki/work/loki/indra-labs/indra
export PATH=/home/loki/work/loki/indra-labs/indra/scripts:$PATH
zsh

7
scripts/cdwork.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/zsh
# populate ~/.workpath thus: `cd path/to/repo/root; pwd>~/.workpath
export INDRAROOT=$(cat ~/.workpath)
export PATH=$INDRAROOT/scripts:$PATH
# put the path of the root of the repository in ./scripts/path
cd $INDRAROOT
zsh

11
scripts/readme.md Normal file
View File

@@ -0,0 +1,11 @@
# scripts
populate ~/.workpath thus: `cd path/to/repo/root; pwd>~/.workpath`
add this to your `~/.bashrc` or `~/.zshrc`:
export PATH=$(cat ~/.workpath)/scripts:$HOME/sdk/go1.19.10/bin:$PATH
export GOBIN=$HOME/.local/bin
`source` the `rc` file or open a new terminal session and type `cdwork.sh` and you will have a number of useful commands
that handle paths and special build parameters to make the code locations work without hard coding them anywhere.

3
scripts/run.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env zsh
reset
go run -tags local -gcflags "all=-trimpath=$INDRAROOT" $1 --logs-level=trace $2 $3 $4 $5

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env zsh
reset
go test -v -tags local -gcflags "all=-trimpath=/home/loki/work/loki/indra-labs/indra" $1 $2 $3 $4 $5
go test -v -tags local -gcflags "all=-trimpath=$INDRAROOT" $1 $2 $3 $4 $5

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env zsh
cd pkg
go test -v -tags local -gcflags "all=-trimpath=/home/loki/work/loki/indra-labs/indra" ./...
go test -v -tags local -gcflags "all=-trimpath=$INDRAROOT" ./...

3
scripts/trace.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env zsh
reset
go run -tags local -gcflags "all=-trimpath=$INDRAROOT" $1 $2 $3 $4 $5