From d68c1de73a5856ba248357173010f19594902e47 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Sun, 14 Jan 2018 16:29:21 +0100 Subject: [PATCH] balls --- Makefile | 27 +++++++++------------------ new_release.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100755 new_release.sh diff --git a/Makefile b/Makefile index 5f546dcc..3dac5876 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ TARGET=bettercap-ng +TO_UPDATE=core/banner.go +CURRENT_VERSION=$(shell cat core/banner.go | grep Version | cut -d '"' -f 2) all: fmt vet build @echo "@ Done" @@ -10,36 +12,22 @@ build: resources @echo "@ Building ..." @go build $(FLAGS) -o $(TARGET) . -resources: - @echo "@ Compiling resources into go files ..." +resources: oui + +oui: @$(GOPATH)/bin/go-bindata -o net/oui_compiled.go -pkg net net/oui.dat vet: - @echo "@ Running VET ..." @go vet ./... fmt: - @echo "@ Formatting ..." @go fmt ./... lint: - @echo "@ Running LINT ..." @golint ./... deps: - @echo "@ Installing dependencies ..." - @go get -u github.com/jteeuwen/go-bindata/... - @go get github.com/elazarl/goproxy - @go get github.com/google/gopacket - @go get github.com/mdlayher/dhcp6 - @go get github.com/malfunkt/iprange - @go get github.com/rogpeppe/go-charset/charset - @go get github.com/chzyer/readline - @go get github.com/robertkrimen/otto - @go get github.com/dustin/go-humanize - @go get github.com/olekukonko/tablewriter - @go get github.com/gin-gonic/gin - @go get gopkg.in/unrolled/secure.v1 + @go get ./... clean: @rm -rf $(TARGET) net/oui_compiled.go @@ -49,3 +37,6 @@ clear_arp: bcast_ping: @ping -b 255.255.255.255 + +release: + @./new_release.sh diff --git a/new_release.sh b/new_release.sh new file mode 100755 index 00000000..3aa35546 --- /dev/null +++ b/new_release.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# nothing to see here, just a utility i use to create new releases ^_^ + +CURRENT_VERSION=$(cat core/banner.go | grep Version | cut -d '"' -f 2) +TO_UPDATE=( + core/banner.go +) + +echo -n "Current version is $CURRENT_VERSION, select new version: " +read NEW_VERSION +echo "Creating version $NEW_VERSION ...\n" + +for file in "${TO_UPDATE[@]}" +do + echo "Patching $file ..." + sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g" $file + git add $file +done + +git commit -m "Releasing v$NEW_VERSION" +git push + +git tag -a v$NEW_VERSION -m "Release v$NEW_VERSION" +git push origin v$NEW_VERSION + +echo +echo "All done, v$NEW_VERSION released ^_^"