You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there,
This isn't an issue but i was hoping to get some advice.
I currently have a golang repository consisting of lots of lambda functions. Currently when i make a change to one lambda function, i have to rebuild them all.
build: clean
@for dir in `ls handler`; do \
echo 'building...' $$dir; \
CGO_ENABLED=0 GOOS=linux go build -o dist/handler/$$dir gitlab.com/repo/code/handler/$$dir; \
done
echo "All built"
gomon:
reflex -R '^node_modules/' -R '^output/' -r '\.go' -s -- sh -c 'make build'
File structure being
-/
-handler/
-apiHandler1/
-apiHandler2/
I think I am extremely close, in rebuilding just one file when it's changed. But am having trouble getting sed to work. When i try my variations with sed, i often get sed: 1: "s|[^/]+|g": unterminated substitute in regular expression
{} has the output of handler/approvedGet/approvedGet.go, but i need handler/approvedGet/ without the file name. For the command CGO_ENABLED=0 GOOS=linux go build -o dist/handler/approvedGet/approvedGet.go gitlab.com/repo/code/handler/approvedGet/
A sed like sed "s|[^/]+|g" would work but i'm having trouble getting it to execute.
I'm hoping to get to the point where i have both {} and another variable in the command without the filename, so i can easily rebuild just the files & packages that have been changed.
Something like would be ideal
gomon:
reflex -R '^node_modules/' -R '^output/' -r '\.go' -s --
sh -c 'CGO_ENABLED=0 GOOS=linux go build -o dist/handler/{} gitlab.com/repo/code/{}_withoutfilename'
Thanks
The text was updated successfully, but these errors were encountered:
Hey there,
This isn't an issue but i was hoping to get some advice.
I currently have a golang repository consisting of lots of lambda functions. Currently when i make a change to one lambda function, i have to rebuild them all.
File structure being
I think I am extremely close, in rebuilding just one file when it's changed. But am having trouble getting
sed
to work. When i try my variations with sed, i often getsed: 1: "s|[^/]+|g": unterminated substitute in regular expression
{}
has the output ofhandler/approvedGet/approvedGet.go
, but i needhandler/approvedGet/
without the file name. For the commandCGO_ENABLED=0 GOOS=linux go build -o dist/handler/approvedGet/approvedGet.go gitlab.com/repo/code/handler/approvedGet/
A sed like
sed "s|[^/]+|g"
would work but i'm having trouble getting it to execute.I'm hoping to get to the point where i have both
{}
and another variable in the command without the filename, so i can easily rebuild just the files & packages that have been changed.Something like would be ideal
Thanks
The text was updated successfully, but these errors were encountered: