Skip to content

Commit

Permalink
Relocate default template so it's available in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
benr77 committed Oct 30, 2022
1 parent 2637a63 commit fb15f76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
yarn
yarn run build --if-present
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json ${{ env.PLUGIN_NAME }}
cp main.js manifest.json default-template.md.hb ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions src/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { compile } from 'handlebars';

export default class Filesystem {

private defaultTemplate = app.vault.configDir + '/plugins/obsidian-gitlab-issues/default-template.md.hb';

private vault: Vault;

private settings: GitlabIssuesSettings;

constructor(vault: Vault, settings: GitlabIssuesSettings) {
Expand Down Expand Up @@ -59,13 +62,11 @@ export default class Filesystem {

private templateLocation(): string
{
const defaultTemplate = app.vault.configDir + '/plugins/obsidian-gitlab-issues/src/default-template.md.hb';

if (this.settings.templateFile.length) {
return this.settings.templateFile;
}

return defaultTemplate;
return this.defaultTemplate;
}

private fileName(issue: Issue): string
Expand Down

0 comments on commit fb15f76

Please sign in to comment.