Skip to content

Commit

Permalink
fix: operating on relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko authored Nov 16, 2020
2 parents c0a5c69 + 754a1f1 commit 8b8f31f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"enexSource": "/../test/data/test-template.enex",
"enexSource": "/test/data/test-template.enex",
"templateFile": "/sampleTemplate.tmpl",
"outputDir": "out",
"isMetadataNeeded": false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yarle-evernote-to-md",
"version": "3.1.0",
"version": "3.1.1",
"description": "Yet Another Rope Ladder from Evernote",
"keywords": [
"evernote",
Expand Down
6 changes: 3 additions & 3 deletions src/dropTheRopeRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export const run = async (opts?: YarleOptions) => {
process.env.YARLEROOTDIR = `${__dirname}/../`;
if (options.enexSource.endsWith('.enex')) {
console.log(`Converting notes in file: ${options.enexSource}`);
options.enexSource = `${__dirname}${options.enexSource}`;
options.enexSource = `${process.cwd()}${options.enexSource}`;
await yarle.dropTheRope(options);

} else {
const enexDir = `${__dirname}${options.enexSource}`;
const enexDir = `${process.cwd()}${options.enexSource}`;
const enexFiles = fs
.readdirSync(`${__dirname}${options.enexSource}`)
.readdirSync(`${process.cwd()}${options.enexSource}`)
.filter((file:any) => {
return file.match(/.*\.enex/ig);
});
Expand Down
2 changes: 1 addition & 1 deletion test/yarle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ describe('dropTheRope ', async () => {
it('Folder of enex files', async () => {

const options:YarleOptions = {
enexSource: '/../test/data/TestDirNotes',
enexSource: '/test/data/TestDirNotes',
outputDir: 'out',
isMetadataNeeded: true,
plainTextNotesOnly: false,
Expand Down

0 comments on commit 8b8f31f

Please sign in to comment.