1 | ;
|
2 |
|
3 | const log = require("npmlog");
|
4 | const childProcess = require("@lerna/child-process");
|
5 |
|
6 | module.exports.isAnythingCommitted = isAnythingCommitted;
|
7 |
|
8 | /**
|
9 | * @param {import("@lerna/child-process").ExecOpts} opts
|
10 | */
|
11 | function isAnythingCommitted(opts) {
|
12 | log.silly("isAnythingCommitted");
|
13 |
|
14 | const anyCommits = childProcess.execSync("git", ["rev-list", "--count", "--all", "--max-count=1"], opts);
|
15 |
|
16 | log.verbose("isAnythingCommitted", anyCommits);
|
17 |
|
18 | return Boolean(parseInt(anyCommits, 10));
|
19 | }
|