Plato on Github
Report Home
lib/scm-schemes/git.js
Maintainability
91.98
Lines of code
35
Difficulty
10.66
Estimated Errors
0.09
Function weight
By Complexity
By SLOC
"use strict"; /** * Git SCM scheme, operating on the repository at current working directory. * * @module scm-schemes/git */ import { simpleGit } from "simple-git"; const _simpleGit = simpleGit(process.cwd()); /** * Add a version tag to the current commit. * * @param {String} version - tag name, already formatted using tag format * @param {Function} cb - standard cb(err, result) callback */ function addVersion(version, cb) { _simpleGit.addTag(version, cb); } /** * Commit changes made to the specified paths. * * @param {String} message - commit message * @param {Array<String>} paths - paths of the files to commit * @param {Function} cb - standard cb(err, result) callback */ function saveChanges(message, paths, cb) { _simpleGit.commit(message, paths, {}, cb); } const exports = { addVersion: addVersion, saveChanges: saveChanges, }; export { exports as default };