@jive-ai/cli 0.0.37 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +31 -16
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3430,7 +3430,7 @@ async function createGraphQLClient() {
|
|
|
3430
3430
|
|
|
3431
3431
|
//#endregion
|
|
3432
3432
|
//#region package.json
|
|
3433
|
-
var version = "0.0.
|
|
3433
|
+
var version = "0.0.39";
|
|
3434
3434
|
|
|
3435
3435
|
//#endregion
|
|
3436
3436
|
//#region src/runner/index.ts
|
|
@@ -4761,10 +4761,11 @@ Host gitlab.com
|
|
|
4761
4761
|
}
|
|
4762
4762
|
this.debugLog("Configuring pull...");
|
|
4763
4763
|
await execAsync$1(`git config pull.rebase false`);
|
|
4764
|
-
this.
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4764
|
+
const defaultBranch = this.ctx.defaultBranch;
|
|
4765
|
+
this.debugLog(`Pulling ${defaultBranch}...`);
|
|
4766
|
+
await execAsync$1(`git pull origin ${defaultBranch}`);
|
|
4767
|
+
this.debugLog(`Checking out ${defaultBranch}...`);
|
|
4768
|
+
await execAsync$1(`git checkout ${defaultBranch}`);
|
|
4768
4769
|
this.debugLog("Checking out branch...");
|
|
4769
4770
|
try {
|
|
4770
4771
|
await execAsync$1(`git checkout ${this.ctx.branch}`);
|
|
@@ -5133,18 +5134,32 @@ async function setupRunnerCommand(options) {
|
|
|
5133
5134
|
let config = null;
|
|
5134
5135
|
const runnerConfigPath = path.join(process.env.HOME || process.env.USERPROFILE || "", ".jive", "runner.json");
|
|
5135
5136
|
async function getRunnerConfig() {
|
|
5136
|
-
if (process.env.JIVE_RUNNER_ID && process.env.JIVE_TEAM_ID) return {
|
|
5137
|
-
id: parseInt(process.env.JIVE_RUNNER_ID),
|
|
5138
|
-
name: process.env.JIVE_RUNNER_NAME || "docker-runner",
|
|
5139
|
-
type: "docker",
|
|
5140
|
-
teamId: process.env.JIVE_TEAM_ID,
|
|
5141
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5142
|
-
};
|
|
5143
5137
|
if (config) return config;
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5138
|
+
let fileConfig = null;
|
|
5139
|
+
try {
|
|
5140
|
+
const configData = await fs.readFile(runnerConfigPath, "utf-8");
|
|
5141
|
+
fileConfig = JSON.parse(configData);
|
|
5142
|
+
} catch {}
|
|
5143
|
+
if (fileConfig) {
|
|
5144
|
+
config = {
|
|
5145
|
+
...fileConfig,
|
|
5146
|
+
...process.env.JIVE_RUNNER_ID && { id: parseInt(process.env.JIVE_RUNNER_ID) },
|
|
5147
|
+
...process.env.JIVE_RUNNER_NAME && { name: process.env.JIVE_RUNNER_NAME },
|
|
5148
|
+
...process.env.JIVE_TEAM_ID && { teamId: process.env.JIVE_TEAM_ID }
|
|
5149
|
+
};
|
|
5150
|
+
return config;
|
|
5151
|
+
}
|
|
5152
|
+
if (process.env.JIVE_RUNNER_ID && process.env.JIVE_TEAM_ID) {
|
|
5153
|
+
config = {
|
|
5154
|
+
id: parseInt(process.env.JIVE_RUNNER_ID),
|
|
5155
|
+
name: process.env.JIVE_RUNNER_NAME || "docker-runner",
|
|
5156
|
+
type: "docker",
|
|
5157
|
+
teamId: process.env.JIVE_TEAM_ID,
|
|
5158
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5159
|
+
};
|
|
5160
|
+
return config;
|
|
5161
|
+
}
|
|
5162
|
+
throw new Error("Failed to load runner config - no config file found and JIVE_RUNNER_ID/JIVE_TEAM_ID env vars not set");
|
|
5148
5163
|
}
|
|
5149
5164
|
async function saveRunnerConfig(config$2) {
|
|
5150
5165
|
await fs.mkdir(path.dirname(runnerConfigPath), { recursive: true });
|