@constructor-io/constructorio-connect-cli
Version:
CLI tool to enable users to interface with the Constructor Connect Ecosystem
24 lines (23 loc) • 671 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isGitRepoInitialized = isGitRepoInitialized;
const child_process_1 = require("child_process");
/**
* Returns true if a git repo is initialized in this folder and false otherwise.
*/
function isGitRepoInitialized() {
try {
const output = (0, child_process_1.execSync)(
//
"git rev-parse --is-inside-work-tree", {
// Don't print the result of this command to the console
stdio: "pipe",
})
.toString()
?.trim();
return output === "true";
}
catch (_error) {
return false;
}
}