Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
songkg7 committed Jun 29, 2024
1 parent 00a6af2 commit 966b14e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/docusaurus/docusaurus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import O2Plugin from '../main';
import { copyMarkdownFile, getFilesInReady, moveFilesV2, vaultAbsolutePath } from '../utils';
import { copyMarkdownFile, getFilesInReady, moveFiles, vaultAbsolutePath } from '../utils';
import { Contents } from '../core/Converter';
import { convertWikiLink } from '../jekyll/WikiLinkConverter';
import { convertFootnotes } from '../jekyll/FootnotesConverter';
Expand Down Expand Up @@ -49,7 +49,7 @@ export const convertToDocusaurus = async (plugin: O2Plugin) => {
});

// move files to docusaurus folder
await moveFilesV2(
await moveFiles(
file,
`${vaultAbsolutePath(plugin)}/${plugin.docusaurus.readyFolder}`,
plugin.docusaurus.targetPath(),
Expand Down
6 changes: 3 additions & 3 deletions src/jekyll/chirpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { convertJekyllResourceLink, ResourceLinkConverter } from './ResourceLink
import { Notice } from 'obsidian';
import { CalloutConverter } from './CalloutConverter';
import { convertFrontMatter, FrontMatterConverter } from './FrontMatterConverter';
import { copyMarkdownFile, moveFilesV2, vaultAbsolutePath } from '../utils';
import { copyMarkdownFile, moveFiles, vaultAbsolutePath } from '../utils';
import { FootnotesConverter } from './FootnotesConverter';
import { ConverterChain } from '../core/ConverterChain';
import { CommentsConverter } from './CommentsConverter';
Expand Down Expand Up @@ -43,7 +43,7 @@ export const convertToChirpyV2 = async (plugin: O2Plugin) => {
});

// move files to chirpy folder
await moveFilesV2(
await moveFiles(
file,
`${vaultAbsolutePath(plugin)}/${settings.readyFolder}`,
settings.targetPath(),
Expand Down Expand Up @@ -89,7 +89,7 @@ export async function convertToChirpy(plugin: O2Plugin) {
.converting(await plugin.app.vault.read(file));

await plugin.app.vault.modify(file, result);
await moveFilesV2(
await moveFiles(
file,
`${vaultAbsolutePath(plugin)}/${settings.readyFolder}`,
settings.targetPath(),
Expand Down
17 changes: 0 additions & 17 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,6 @@ export const achieve = async (plugin: O2Plugin, settings: O2PluginSettings) => {
};

export const moveFiles = async (
plugin: O2Plugin,
settings: O2PluginSettings,
) => {
const sourceFolderPath = `${vaultAbsolutePath(plugin)}/${settings.readyFolder}`;
const targetFolderPath = settings.targetPath();


copy(
sourceFolderPath,
targetFolderPath,
(year, month, day, title) => {
return settings.pathReplacer(year, month, day, title);
},
);
};

export const moveFilesV2 = async (
file: TFile,
sourceFolderPath: string,
targetFolderPath: string,
Expand Down

0 comments on commit 966b14e

Please sign in to comment.