mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Remove use of path module
This commit is contained in:
parent
da2a345bd7
commit
16459572a0
2 changed files with 3 additions and 8 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { Vault, requestUrl } from "obsidian";
|
||||
import MetadataStore from "../metadata-store";
|
||||
import * as path from "path";
|
||||
|
||||
export default class GithubClient {
|
||||
constructor(
|
||||
|
|
@ -55,7 +54,7 @@ export default class GithubClient {
|
|||
repo,
|
||||
dir.path,
|
||||
branch,
|
||||
path.join(localContentDir, dir.name),
|
||||
`${localContentDir}/${dir.name}`,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
@ -103,7 +102,7 @@ export default class GithubClient {
|
|||
const res = await requestUrl({
|
||||
url: url,
|
||||
});
|
||||
const destinationPath = path.dirname(destinationFile);
|
||||
const destinationPath = destinationFile.split("/").slice(0, -1).join("/");
|
||||
if (!this.vault.getFolderByPath(destinationPath)) {
|
||||
this.vault.createFolder(destinationPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { Vault } from "obsidian";
|
||||
import * as path from "path";
|
||||
|
||||
/**
|
||||
* A file metadata.
|
||||
|
|
@ -32,10 +31,7 @@ export default class MetadataStore {
|
|||
private writeQueue: Promise<void> = Promise.resolve();
|
||||
|
||||
constructor(private vault: Vault) {
|
||||
this.metadataFile = path.join(
|
||||
this.vault.configDir,
|
||||
"obsidian-github-sync-metadata.json",
|
||||
);
|
||||
this.metadataFile = `${this.vault.configDir}/obsidian-github-sync-metadata.json`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue