Added /wp-cli.sh endpoint
This commit is contained in:
@@ -2,6 +2,7 @@ package pages
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -12,4 +13,18 @@ func InitHttpHandlers() {
|
|||||||
http.HandleFunc("/{$}", homepage)
|
http.HandleFunc("/{$}", homepage)
|
||||||
http.HandleFunc("/.well-known/autoconfig/mail/config-v1.1.xml", emailAutoconfig)
|
http.HandleFunc("/.well-known/autoconfig/mail/config-v1.1.xml", emailAutoconfig)
|
||||||
http.HandleFunc("/mail/config-v1.1.xml", emailAutoconfig)
|
http.HandleFunc("/mail/config-v1.1.xml", emailAutoconfig)
|
||||||
|
http.HandleFunc("/wp-cli.sh", wpCliSh)
|
||||||
|
}
|
||||||
|
|
||||||
|
func wpCliSh(w http.ResponseWriter, r *http.Request) {
|
||||||
|
cliScript := `#!/bin/bash
|
||||||
|
|
||||||
|
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||||
|
chmod +x wp-cli.phar
|
||||||
|
mv wp-cli.phar wp
|
||||||
|
./wp
|
||||||
|
`
|
||||||
|
|
||||||
|
w.Header().Set("Content-Type", "text/plain")
|
||||||
|
_, _ = io.WriteString(w, cliScript)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user