mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
- Remove package-lock.json from .gitignore so npm ci works in CI - Refactor main.js: delegate PDF ops to src/main/PDFOperations.js, git ops to src/main/GitOperations.js - getPandocPath(): use bundled binary from resources/bin/ when packaged, fall back to dev bin/ or system pandoc in development - getFFmpegPath(): use ffmpeg-static (asarUnpack) when packaged - Install ffmpeg-static (v5.3.0, bundled 76MB binary) - Add scripts/download-tools.js to fetch pandoc binary at build time (idempotent, runs on CI before electron-builder) - electron-builder: add asarUnpack for ffmpeg-static, extraFiles for pandoc binary per platform (linux + win32) - release.yml: switch build-windows to windows-latest runner with native NSIS support; add cert decode step; add download-tools step for both linux and windows jobs - Fix lint error: hoist outlinePanelContainer to module scope so TabManager methods can reference it without no-undef errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
45 lines
896 B
JavaScript
45 lines
896 B
JavaScript
const simpleGit = require('simple-git');
|
|
|
|
function getGitInstance(dir) {
|
|
return simpleGit(dir);
|
|
}
|
|
|
|
async function getStatus(dir) {
|
|
try {
|
|
const git = getGitInstance(dir);
|
|
return await git.status();
|
|
} catch (err) {
|
|
return { error: 'Not a git repository' };
|
|
}
|
|
}
|
|
|
|
async function stage(dir, files) {
|
|
try {
|
|
const git = getGitInstance(dir);
|
|
await git.add(files);
|
|
return await git.status();
|
|
} catch (err) {
|
|
return { error: err.message };
|
|
}
|
|
}
|
|
|
|
async function commit(dir, message) {
|
|
try {
|
|
const git = getGitInstance(dir);
|
|
return await git.commit(message);
|
|
} catch (err) {
|
|
return { error: err.message };
|
|
}
|
|
}
|
|
|
|
async function log(dir, maxCount = 20) {
|
|
try {
|
|
const git = getGitInstance(dir);
|
|
return await git.log({ maxCount });
|
|
} catch (err) {
|
|
return { error: err.message };
|
|
}
|
|
}
|
|
|
|
module.exports = { getStatus, stage, commit, log };
|