[#26] Started writing fejctl
parent
21e142e9a4
commit
22e9dcceaf
|
@ -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 "$@"
|
Loading…
Reference in New Issue