Check if git repo root in plugin update
| @@ -8,7 +8,7 @@ import path from 'node:path'; | |||
| 8 | import process from 'node:process'; | 8 | import process from 'node:process'; |
| 9 | import { fileURLToPath } from 'node:url'; | 9 | import { fileURLToPath } from 'node:url'; |
| 10 | 10 | ||
| 11 | import { default as git } from 'simple-git'; | 11 | import { default as git, CheckRepoActions } from 'simple-git'; |
| 12 | import { color } from './src/util.js'; | 12 | import { color } from './src/util.js'; |
| 13 | 13 | ||
| 14 | const __dirname = import.meta.dirname ?? path.dirname(fileURLToPath(import.meta.url)); | 14 | const __dirname = import.meta.dirname ?? path.dirname(fileURLToPath(import.meta.url)); |
| @@ -49,7 +49,7 @@ async function updatePlugins() { | |||
| 49 | const pluginPath = path.join(pluginsPath, directory); | 49 | const pluginPath = path.join(pluginsPath, directory); |
| 50 | const pluginRepo = git(pluginPath); | 50 | const pluginRepo = git(pluginPath); |
| 51 | 51 | ||
| 52 | const isRepo = await pluginRepo.checkIsRepo(); | 52 | const isRepo = await pluginRepo.checkIsRepo(CheckRepoActions.IS_REPO_ROOT); |
| 53 | if (!isRepo) { | 53 | if (!isRepo) { |
| 54 | console.log(`Directory ${color.yellow(directory)} is not a Git repository`); | 54 | console.log(`Directory ${color.yellow(directory)} is not a Git repository`); |
| 55 | continue; | 55 | continue; |
| @@ -3,7 +3,7 @@ import path from 'node:path'; | |||
| 3 | import url from 'node:url'; | 3 | import url from 'node:url'; |
| 4 | 4 | ||
| 5 | import express from 'express'; | 5 | import express from 'express'; |
| 6 | import { default as git } from 'simple-git'; | 6 | import { default as git, CheckRepoActions } from 'simple-git'; |
| 7 | import { sync as commandExistsSync } from 'command-exists'; | 7 | import { sync as commandExistsSync } from 'command-exists'; |
| 8 | import { getConfigValue, color } from './util.js'; | 8 | import { getConfigValue, color } from './util.js'; |
| 9 | 9 | ||
| @@ -256,7 +256,7 @@ async function updatePlugins(pluginsPath) { | |||
| 256 | const pluginPath = path.join(pluginsPath, directory); | 256 | const pluginPath = path.join(pluginsPath, directory); |
| 257 | const pluginRepo = git(pluginPath); | 257 | const pluginRepo = git(pluginPath); |
| 258 | 258 | ||
| 259 | const isRepo = await pluginRepo.checkIsRepo(); | 259 | const isRepo = await pluginRepo.checkIsRepo(CheckRepoActions.IS_REPO_ROOT); |
| 260 | if (!isRepo) { | 260 | if (!isRepo) { |
| 261 | continue; | 261 | continue; |
| 262 | } | 262 | } |