Skip to content

Commit

Permalink
improve(plugin): export api of exec_git_command
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 authored and tiensonqin committed Dec 21, 2021
1 parent 613b57e commit 42fca33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/src/LSPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ export interface IAppProxy {
quit: () => Promise<void>
openExternalLink: (url: string) => Promise<void>

/**
* @link https://github.com/desktop/dugite/blob/master/docs/api/exec.md
* @param args
*/
execGitCommand: (args: string[]) => Promise<string>

// graph
getCurrentGraph: () => Promise<AppGraphInfo | null>

Expand Down
6 changes: 6 additions & 0 deletions src/main/logseq/api.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
[promesa.core :as p]
[reitit.frontend.easy :as rfe]
[sci.core :as sci]
[frontend.handler.shell :as shell]
[frontend.modules.layout.core]))

;; helpers
Expand Down Expand Up @@ -615,6 +616,11 @@
(when-let [repo (state/get-current-repo)]
(export-handler/export-repo-as-zip! repo)))

(defn ^:export exec_git_command
[^js args]
(when-let [args (and args (seq (bean/->clj args)))]
(shell/run-git-command! args)))

;; helpers
(defn ^:export show_msg
([content] (show_msg content :success))
Expand Down

0 comments on commit 42fca33

Please sign in to comment.