Open lodi-g opened 1 year ago
I tested it on a Remote SSH editor and it doesn't work well. Not sure why.
After reading the code about using caddy fmt
and tested on my vm, i think cat /dev/stdin
isn't necessary in this case.
I am tying this too:
this is my code:
cat >/usr/bin/caddy <<EOF
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
podman run --rm -i docker.io/caddy:latest caddy "$@"
EOF
chmod +x /usr/bin/caddy
this will create a file reference for caddy, using this with the extension work
pwd: ${HOME}/caddytxt
inside this folder I have a Caddyfile and executing
caddy fmt --overwrite
will edit the file and fix the format.
Problem I have not installed Caddy on my dev machine and do not wish to do so. However, I still want to use caddy fmt. It's easy to run it manually via Docker but doesn't leverage the full features of this extension.
Solution I wrote a super simple wrapper script to make this extension work with a dockerized Caddy. It could be interesting to add it to the documentation. It works on MacOS (and most likely on Linux, not tested).
Once the script is set up somewhere, just point
caddy.executable
to it and it works.