diff --git a/index.js b/index.js index e1ef9ef..3130eba 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,8 @@ require("dotenv").config() const GIT_URI = process.env.GIT_URI const GIT_BRANCH = process.env.GIT_BRANCH || "main" +const shouldGenerateKeys = process.env.GENERATE_KEYS || GIT_URI.startsWith("ssh://") || false + const PROJECT_DIR = resolvePath(__dirname + "\\project") const KEY_DIR = resolvePath(__dirname + "\\keys") @@ -51,6 +53,11 @@ async function tryGenerateKeys() { console.log("no need to generate key, already exists") return; } + if (!shouldGenerateKeys) { + console.log("shouldGenerateKeys is false, skipping key generation") + return; + } + console.log("Generating keys...") const aPromise = new Promise(function(resolve, reject) { keygen({ location: KEY_LOCATION,