summaryrefslogtreecommitdiff
path: root/project
blob: c1daf5021c4c45651af7f9a4a84ea56dd7bc3a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

project_name="atui"

function compile(){
  if [ ! -d build ]; then
    if [ $(mkdir build) ]; then # if error
      echo "cannot make 'build' dir"
      exit
    fi
  fi

  gcc -Wall -Wextra -O3 src/main.c src/ui/tui.c -o "build/$project_name"
}

function run(){
  compile && "./build/$project_name" "$@"
  echo
  echo "$?"
}

function clear(){
  rm -r ./build/
}

function_name="$1"
shift

$function_name "$@"