Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/helper/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ export const BUTTONS = [
];

export const SETTINGS_SCHEMA: SettingSchemaDesc[] = [
{
key: "customRepoRoot",
title: "Custom Repository Root Path",
type: "string",
default: "/",
description:
"Custom repository root, relative to the current graph root (can contain `..` path nodes). Defaults to /, which means the graph root.",
},
{
key: "buttons",
title: "Buttons",
Expand Down
12 changes: 10 additions & 2 deletions src/helper/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ export const execGitCommand = async (args: string[]) : Promise<IGitResult> => {

let res
try {
const currentGitFolder = (await logseq.App.getCurrentGraph())?.path
const runArgs = currentGitFolder ? ['-C', currentGitFolder, ...args] : args
const currentGitFolder = (await logseq.App.getCurrentGraph())?.path;
const relCurrGitFolder = currentGitFolder
? //path.resolve(
(((currentGitFolder as string) +
"/" +
logseq.settings?.customRepoRoot) as string)
: //)
(logseq.settings?.customRepoRoot as string);
const runArgs = relCurrGitFolder ? ["-C", relCurrGitFolder, ...args] : args;
//const runArgs = currentGitFolder ? ["-C", currentGitFolder, ...args] : args;
_inProgress = logseq.Git.execCommand(runArgs)
res = await _inProgress
} finally {
Expand Down