Hacker News new | comments | ask | show | jobs | submit login

That kind of anaemic Makefile in the article can be expressed as a single case statement in a plain POSIX shell script:

    #!/bin/sh
    set -e

    case "$1" in
        up)
            docker-compose up -d
            ;;

        build)
            docker-compose rm -vsf
            docker-compose down -v --remove-orphans
            docker-compose build
            docker-compose up -d
            ;;
        *)
            echo "unknown verb: $1"
            ;;
    esac
I honestly think there's a phenomenon where, since the bash man page is too bloated, looking up shell syntax has become a no-no. So if people don't already know the syntax for what they want to do, they treat shell scripting as a lost cause.



The idea of your shell script and Makefile are the same. For me it doesn't matter which one is used but source code should have some kind of easily usable list of common development tasks. Otherwise developers are doing this and that and the easier ways of doing repeatable stuff are not getting propagated to everybody.


Yes indeed. My comment was only tangential to that aspect.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: