Skip to content

Commit

Permalink
creating root output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko committed Dec 26, 2023
1 parent f6f9308 commit 1c8d66e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/folder-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ export const getRelativeResourceDir = (note: any): string => {
: `.${enexFolder}${path.sep}${getResourceDir(paths.mdPath, note)}.resources`;
};

export const createRootOutputDir = (): void => {
const outputDir = path.isAbsolute(yarleOptions.outputDir)
? yarleOptions.outputDir
: `${process.cwd()}${path.sep}${yarleOptions.outputDir}`;
fsExtra.mkdirsSync(outputDir)
}
export const getAbsoluteResourceDir = (note: any): string => {
if (yarleOptions.haveGlobalResources) {
return path.resolve(paths.resourcePath, '..', '..', yarleOptions.resourcesDir);
Expand Down
1 change: 1 addition & 0 deletions src/yarle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const saveOptionsAsConfig = (options: YarleOptions): void => {
export const dropTheRope = async (options: YarleOptions): Promise<Array<string>> => {
clearLogFile();
setOptions(options);
utils.createRootOutputDir();
saveOptionsAsConfig(options)
const outputNotebookFolders = [];
for (const enex of options.enexSources) {
Expand Down

0 comments on commit 1c8d66e

Please sign in to comment.