create-octoherd-script
Version:
CLI to create a new folder and repository for an Octoherd Script
11 lines (8 loc) • 376 B
JavaScript
import { readFileSync } from "fs";
import { join as pathJoin, dirname } from "path";
import { fileURLToPath } from "url";
export default function getTemplateFileContent(filename) {
// https://stackoverflow.com/a/50052194/206879
const __dirname = dirname(fileURLToPath(import.meta.url));
return readFileSync(pathJoin(__dirname, "..", "templates", filename), "utf8");
}