air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.38k stars 772 forks source link

Add Podman/Docker container control like app with function in the shellrc #469

Closed DevDorrejo closed 8 months ago

DevDorrejo commented 9 months ago

Hello,

This allows the user/dev to use air in a more practical way in a rootless (while using podman) dev environment.

air() {
    podman run -it --rm \
        -w "$PWD" -v "$PWD":"$PWD" \
        -p "$AIR_PORT":"$AIR_PORT" \
        docker.io/cosmtrek/air "$@"
}

you add this piece of code in .bashrc of example, then run the code: AIR_PORT=8080 air init > this will create the .air.toml

AIR_PORT=8080 air -c .ait.toml this will run the .air.toml created by the init.