fix: normalize template file loadup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import { readdir, readFile } from 'fs/promises';
|
||||
import { readFile } from 'fs/promises';
|
||||
import ghStarFetch from 'gh-star-fetch';
|
||||
|
||||
import {
|
||||
@@ -9,11 +10,13 @@ import {
|
||||
pushNewFiles,
|
||||
MARKDOWN_FILENAME,
|
||||
} from './helpers';
|
||||
import MD_TEMPLATE from './template';
|
||||
|
||||
export async function main() {
|
||||
// set default template
|
||||
let template = MD_TEMPLATE;
|
||||
let template = await readFile(
|
||||
path.resolve(__dirname, './TEMPLATE.md'),
|
||||
'utf8'
|
||||
);
|
||||
|
||||
// get template if found in the repo
|
||||
const customTemplatePath = core.getInput('template-path');
|
||||
|
@@ -1,14 +0,0 @@
|
||||
export default `# <%= username %> Awesome List [](https://github.com/sindresorhus/awesome)
|
||||
|
||||
> :star: generated with [simonecorsi/mawesome](https://github.com/simonecorsi/mawesome)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
<% for(let [language, repositories] of stars) { %>
|
||||
## <%= language %>
|
||||
|
||||
<% for(let repo of repositories) { %>- [<%= repo.full_name %>](<%= repo.html_url %>) - <%= repo.description %>
|
||||
<% } %>
|
||||
|
||||
<% } %>
|
||||
`;
|
Reference in New Issue
Block a user