Skip to content

Instantly share code, notes, and snippets.

@kuritka
Last active December 1, 2021 11:22
Show Gist options
  • Save kuritka/1ae90656fe3c2ab32cf73e8026301a21 to your computer and use it in GitHub Desktop.
Save kuritka/1ae90656fe3c2ab32cf73e8026301a21 to your computer and use it in GitHub Desktop.
make-tools

I invested a little time today in something like this:

SHELL := /bin/bash

init=@./make-tools --init -m "starting"
save=@./make-tools --message "saving value" --save
load=@./make-tools --debug --load
exists=@./make-tools -m "environment variable doesn't exist" --env-exists
# Options

export ENV_SECRET="secret"
t:
	go build -o make-tools main.go
	$(init)
	$(exists) ENV_SECRET
	$(save) encoded1=`echo -n yyy | base64`
	$(save) encoded2=`echo bubu | base64`
	$(load) encoded1
	@echo
	$(save) hello=SGVsbG8gZnJvbSBFTkNPREVE
	@echo "the encoded message: `./make-tools -l hello | base64 -d`"
❯ make t
go build -o make-tools main.go
starting
saving value
saving value
12:21PM DBG Debug mode enabled
12:21PM DBG loaded 'encoded1':'eXl5'
eXl5
saving value
the encoded message: Hello from ENCODED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment