UNPKG

818 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var child_process_1 = require("child_process");
4var fs_extra_1 = require("fs-extra");
5var path_1 = require("path");
6/**
7 * 提交git
8 *
9 * @param appPath 项目目录
10 */
11function gitCommit(appPath) {
12 try {
13 child_process_1.execSync('git add -A', { stdio: 'ignore', cwd: appPath });
14 child_process_1.execSync('git commit -m "Initial commit from ts-lib-scripts"', {
15 stdio: 'ignore',
16 cwd: appPath,
17 });
18 }
19 catch (e) {
20 try {
21 fs_extra_1.removeSync(path_1.join(appPath, '.git'));
22 }
23 catch (removeErr) {
24 // 忽略
25 }
26 throw e;
27 }
28}
29exports.default = gitCommit;
30//# sourceMappingURL=gitCommit.js.map
\No newline at end of file