[#26] Started writing fejctl

master^2
Jef Roosens 2021-04-15 22:46:23 +02:00
parent 21e142e9a4
commit 22e9dcceaf
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
1 changed files with 35 additions and 0 deletions

35
fejctl 100755
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
# This script is a helpful utility for developing fej inside Docker.
# Default values
image="chewingbever/fej"
mode="dev" # Should be either 'rel' or 'dev'
action=""
attach="--detach"
cmd="b"
bin="server"
# Calculated variables
patch_version=`grep -Po '(?<=version = ").*(?=")' Cargo.toml | head -n1`
major_version=`echo "$patch_version" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/'`
minor_version=`echo "$patch_version" | sed -E 's/([0-9]+).([0-9]+).([0-9]+)/\1.\2/'`
branch=`git rev-parse --abbrev-ref HEAD`
function main() {
# Parse the flags
while getopts ":i:m:a:l" c; do
case $c in
i ) image="$OPTARG" ;;
m ) mode="$OPTARG" ;;
a ) action="$OPTARG" ;;
l ) attach="" ;;
? ) exit 1 ;;
esac
done
shift $((OPTIND-1))
}
main "$@"