Skip to content

Commit

Permalink
🐛 Fix examples and templates not showing when ctjs is run outside of …
Browse files Browse the repository at this point in the history
…your home directory (#357 by @leedigital)
  • Loading branch information
leedigital authored Aug 3, 2022
1 parent 3590b93 commit 694afdf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/node_requires/resources/projects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const getExamplesDir = function (): string {
if (isMac) {
return path.join(process.cwd(), 'examples');
}
return path.join((nw.App as any).startPath, 'examples');
// return path.join((nw.App as any).startPath, 'examples');
return path.join(path.dirname(process.execPath), "examples");
}
};

Expand All @@ -35,7 +36,8 @@ const getTemplatesDir = function (): string {
if (isMac) {
return path.join(process.cwd(), 'templates');
}
return path.join((nw.App as any).startPath, 'templates');
// return path.join((nw.App as any).startPath, "templates");
return path.join(path.dirname(process.execPath), "templates");
}
};

Expand Down

0 comments on commit 694afdf

Please sign in to comment.