akosbalasko / akosbalasko/yarle
Custom template specified in config.json is ignored when run as a local npm script
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 111
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hello,
I've encountered a persistent issue where YARLE ignores the `template` setting in a local `config.json` file when executed as an npm script. It consistently falls back to the built-in default template, resulting in incorrect output.
**Environment:**
* **OS:** Windows 11
* **YARLE Version:** `yarle-evernote-to-md@6.16.0`
* **Execution Method:** `npm run ` from a local project.
**Problem Description:**
Even when providing a valid `config.json` via the `--configFile` flag, and after ensuring no global config exists in `%APPDATA%`, the conversion log shows that `currentTemplate` is the default YARLE template, not the content of the file specified in the `template` property.
**Steps to Reproduce:**
1. Create a new folder and run `npm init -y`.
2. Install YARLE: `npm install --save-dev yarle-evernote-to-md`
3. Create `config.json` in the project root:
```json
{
"enexSources": ["path/to/any.enex"],
"outputDir": "./output",
"template": "./yarle-template.tmpl",
"isMetadataNeeded": true,
"skipSubjectDate": false
}
```
4. Create `yarle-template.tmpl` in the project root:
```tmpl
---
tags: [{tags}]
created: "{created-at}"
---
# {title}
{content}
```
5. Add a script to `package.json`:
```json
"scripts": {
"convert": "yarle --configFile ./config.json"
}
```
6. Run the script: `npm run convert`
**Expected Behavior:**
The output Markdown files should be formatted according to `yarle-template.tmpl`. The conversion log should show the custom template string in the `currentTemplate` field.
**Actual Behavior:**
The output uses the default YARLE template. The conversion log shows the default template string in the `currentTemplate` field, proving the custom template file was not loaded.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.