glop.dev 0.1.0 → 0.3.0
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.js +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,8 +41,8 @@ function saveConfig(config) {
|
|
|
41
41
|
ensureConfigDir();
|
|
42
42
|
fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return process.env.GLOP_SERVER_URL ||
|
|
44
|
+
function getDefaultServerUrl() {
|
|
45
|
+
return process.env.GLOP_SERVER_URL || "https://www.glop.dev";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// src/commands/auth.ts
|
|
@@ -68,7 +68,7 @@ function findOpenPort() {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
var authCommand = new Command("auth").description("Authenticate with a glop server").option("-s, --server <url>", "Server URL").action(async (opts) => {
|
|
71
|
-
const serverUrl = (opts.server ||
|
|
71
|
+
const serverUrl = (opts.server || getDefaultServerUrl()).replace(/\/+$/, "");
|
|
72
72
|
const port = await findOpenPort();
|
|
73
73
|
const machineId = getMachineId();
|
|
74
74
|
console.log("Opening browser for authentication...");
|
|
@@ -427,7 +427,12 @@ var hookCommand = new Command4("__hook").description("internal").action(async ()
|
|
|
427
427
|
});
|
|
428
428
|
if (payload.hook_event_name === "SessionStart") {
|
|
429
429
|
if (res.ok) {
|
|
430
|
+
const body = await res.json();
|
|
431
|
+
const runUrl = body.run_id ? `${config.server_url}/runs/${body.run_id}` : null;
|
|
430
432
|
console.log(`glop: connected to ${config.server_url}`);
|
|
433
|
+
if (runUrl) {
|
|
434
|
+
console.log(`glop: Add "Glop-Run: ${runUrl}" as a git trailer in all commit messages and PR descriptions.`);
|
|
435
|
+
}
|
|
431
436
|
} else if (res.status === 401) {
|
|
432
437
|
console.log("glop: API key expired or invalid \u2014 run `glop auth` to re-authenticate");
|
|
433
438
|
} else {
|