package main

import (
	_ "embed"
	"os"
	"path/filepath"
)

//go:embed muplugins/edubox-public-url.php
var muPluginContent []byte

func writeMUPlugin(dataDir string) (string, error) {
	dir := filepath.Join(dataDir, "mu-plugins")
	if err := os.MkdirAll(dir, 0755); err != nil {
		return "", err
	}
	path := filepath.Join(dir, "edubox-public-url.php")
	if err := os.WriteFile(path, muPluginContent, 0644); err != nil {
		return "", err
	}
	return path, nil
}
