Skip to content

Commit c958edc

Browse files
committed
Publish
1 parent 0911f28 commit c958edc

27 files changed

Lines changed: 647 additions & 487 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
-
99
-->
1010

11+
# 4.10.1
12+
## Fixes and improvements
13+
- `rapids` now buckets cached-requests together
14+
- Try harder to avoid fingerprint question from SSH
15+
- Don't fail `deploy` in new repos
16+
- Don't suggest duplicating the `repo` you are creating
17+
1118
# 4.10.0
1219
## Added features
1320
- Can select which email to `join` with

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const FINGERPRINT = `AAAAC3NzaC1lZDI1NTE5AAAAIPLSjAn8YwNclgEEk8fgyNb1pbhn9X7bMKwFUweaoPzn`;
2-
export const MERRYMAKE_IO = `merrymake.io`;
2+
export const MERRYMAKE_IO = process.env["ASDF_DOMAIN"] || `merrymake.io`;
33
export const API_URL = `api.${MERRYMAKE_IO}`;
44
export const RAPIDS_HOST = `https://rapids.${MERRYMAKE_IO}`;
55
export const HTTP_HOST = `https://${API_URL}`;

config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const FINGERPRINT = `AAAAC3NzaC1lZDI1NTE5AAAAIPLSjAn8YwNclgEEk8fgyNb1pbhn9X7bMKwFUweaoPzn`;
2-
export const MERRYMAKE_IO = `merrymake.io`;
2+
export const MERRYMAKE_IO = process.env["ASDF_DOMAIN"] || `merrymake.io`;
33
export const API_URL = `api.${MERRYMAKE_IO}`;
44
export const RAPIDS_HOST = `https://rapids.${MERRYMAKE_IO}`;
55

index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { initializeArgs } from "./args.js";
33
import { abort, setDryrun } from "./exitMessages.js";
44
import { index } from "./newCommands/index.js";
55
import { addKnownHost } from "./newCommands/register.js";
6-
import { CTRL_C, moveToBottom } from "./prompt.js";
7-
import { checkVersionIfOutdated, package_json } from "./printUtils.js";
6+
import { CTRL_C, moveToBottom, NORMAL_COLOR } from "./prompt.js";
7+
import { checkVersionIfOutdated, outputGit, package_json, } from "./printUtils.js";
88
process.argv.splice(0, 1); // Remove node
99
process.argv.splice(0, 1); // Remove index
1010
if (process.argv.length > 0 && process.argv[0].endsWith("version")) {
@@ -45,10 +45,17 @@ if (stdin.isTTY) {
4545
})().catch((e) => {
4646
moveToBottom();
4747
const eStr = "" + e;
48-
if (eStr.includes("Permission denied")) {
48+
if (eStr.includes("Permission denied (publickey)")) {
4949
addKnownHost();
50-
console.log("\x1b[31mAn error occurred, please try again. If the problem persists reach out on http://discord.merrymake.eu \x1b[0m", e);
50+
outputGit(`A permission error occurred. Please try these solutions:
51+
1. Make sure you have registered the device with the correct email using 'mm start'
52+
2. Run 'mm help'
53+
3. Run this command again.
54+
4. If the problem persists reach out on http://discord.merrymake.eu` +
55+
NORMAL_COLOR);
56+
}
57+
else {
58+
console.error(`\x1b[31mERROR ${eStr.trimEnd()}\x1b[0m`);
5159
}
52-
console.log(`\x1b[31mERROR ${eStr.trimEnd()}\x1b[0m`);
5360
abort();
5461
});

index.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import { initializeArgs } from "./args.js";
33
import { abort, setDryrun } from "./exitMessages.js";
44
import { index } from "./newCommands/index.js";
55
import { addKnownHost } from "./newCommands/register.js";
6-
import { CTRL_C, moveToBottom } from "./prompt.js";
7-
import { checkVersionIfOutdated, package_json } from "./printUtils.js";
6+
import { CTRL_C, moveToBottom, NORMAL_COLOR, RED } from "./prompt.js";
7+
import {
8+
checkVersionIfOutdated,
9+
outputGit,
10+
package_json,
11+
} from "./printUtils.js";
812

913
process.argv.splice(0, 1); // Remove node
1014
process.argv.splice(0, 1); // Remove index
@@ -54,13 +58,18 @@ if (stdin.isTTY) {
5458
})().catch((e) => {
5559
moveToBottom();
5660
const eStr = "" + e;
57-
if (eStr.includes("Permission denied")) {
61+
if (eStr.includes("Permission denied (publickey)")) {
5862
addKnownHost();
59-
console.log(
60-
"\x1b[31mAn error occurred, please try again. If the problem persists reach out on http://discord.merrymake.eu \x1b[0m",
61-
e
63+
outputGit(
64+
`A permission error occurred. Please try these solutions:
65+
1. Make sure you have registered the device with the correct email using 'mm start'
66+
2. Run 'mm help'
67+
3. Run this command again.
68+
4. If the problem persists reach out on http://discord.merrymake.eu` +
69+
NORMAL_COLOR
6270
);
71+
} else {
72+
console.error(`\x1b[31mERROR ${eStr.trimEnd()}\x1b[0m`);
6373
}
64-
console.log(`\x1b[31mERROR ${eStr.trimEnd()}\x1b[0m`);
6574
abort();
6675
});

newCommands/clone.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from "fs";
22
import { GIT_HOST } from "../config.js";
33
import { choice } from "../prompt.js";
44
import { OrganizationId, PathToOrganization } from "../types.js";
5-
import { execPromise, sshReq, toFolderName } from "../utils.js";
5+
import { execPromise, sshReq, toFolderName, toSubdomain, } from "../utils.js";
66
import { outputGit } from "../printUtils.js";
77
import { ensureGroupStructure } from "./fetch.js";
88
import { listOrgs } from "./org.js";
@@ -55,11 +55,24 @@ export async function checkout() {
5555
const orgs = await listOrgs();
5656
return choice("Which organization would you like to clone?", orgs.map((org) => ({
5757
long: org.id,
58-
text: `${org.name} (${org.id})`,
58+
text: `${org.name}`,
5959
action: () => checkout_org(org.name, new OrganizationId(org.id)),
6060
})));
6161
}
6262
catch (e) {
6363
throw e;
6464
}
6565
}
66+
export async function checkoutName(name) {
67+
try {
68+
const subdomain = toSubdomain(name);
69+
const org = (await listOrgs()).find((x) => toSubdomain(x.name) === subdomain);
70+
if (org === undefined)
71+
return checkout();
72+
else
73+
return checkout_org(org.name, new OrganizationId(org.id));
74+
}
75+
catch (e) {
76+
throw e;
77+
}
78+
}

newCommands/clone.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import fs from "fs";
22
import { GIT_HOST } from "../config.js";
33
import { choice } from "../prompt.js";
44
import { OrganizationId, PathToOrganization } from "../types.js";
5-
import { OrgFile, execPromise, sshReq, toFolderName } from "../utils.js";
5+
import {
6+
OrgFile,
7+
execPromise,
8+
sshReq,
9+
toFolderName,
10+
toSubdomain,
11+
} from "../utils.js";
612
import { outputGit } from "../printUtils.js";
713
import { ToBeStructure, ensureGroupStructure } from "./fetch.js";
814
import { listOrgs } from "./org.js";
@@ -87,11 +93,24 @@ export async function checkout() {
8793
"Which organization would you like to clone?",
8894
orgs.map((org) => ({
8995
long: org.id,
90-
text: `${org.name} (${org.id})`,
96+
text: `${org.name}`,
9197
action: () => checkout_org(org.name, new OrganizationId(org.id)),
9298
}))
9399
);
94100
} catch (e) {
95101
throw e;
96102
}
97103
}
104+
105+
export async function checkoutName(name: string) {
106+
try {
107+
const subdomain = toSubdomain(name);
108+
const org = (await listOrgs()).find(
109+
(x) => toSubdomain(x.name) === subdomain
110+
);
111+
if (org === undefined) return checkout();
112+
else return checkout_org(org.name, new OrganizationId(org.id));
113+
} catch (e) {
114+
throw e;
115+
}
116+
}

newCommands/deploy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ async function rebaseOntoMain(monorepo) {
5858
const mat = a.match(/ref: refs\/heads\/(.+)\t/);
5959
return mat === null ? undefined : mat[1];
6060
})(await execute(`git ls-remote --symref origin HEAD 2>&1`));
61-
const output = await execute(`git fetch && ({ ! git ls-remote --exit-code origin ${remoteHead} >/dev/null; } || git rebase origin/${remoteHead}) && git push origin HEAD:${remoteHead} 2>&1`, true);
61+
const output = await execute((remoteHead !== undefined
62+
? `git fetch && ({ ! git ls-remote --exit-code origin ${remoteHead} >/dev/null; } || git rebase origin/${remoteHead}) && `
63+
: "") + `git push origin HEAD:${remoteHead || "main"} 2>&1`, true);
6264
if (output.trimEnd().endsWith("Everything up-to-date") && !monorepo) {
6365
return choice("Would you like to redeploy?", [
6466
{

newCommands/deploy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ async function rebaseOntoMain(monorepo: boolean) {
7171
return mat === null ? undefined : mat[1];
7272
})(await execute(`git ls-remote --symref origin HEAD 2>&1`));
7373
const output = await execute(
74-
`git fetch && ({ ! git ls-remote --exit-code origin ${remoteHead} >/dev/null; } || git rebase origin/${remoteHead}) && git push origin HEAD:${remoteHead} 2>&1`,
74+
(remoteHead !== undefined
75+
? `git fetch && ({ ! git ls-remote --exit-code origin ${remoteHead} >/dev/null; } || git rebase origin/${remoteHead}) && `
76+
: "") + `git push origin HEAD:${remoteHead || "main"} 2>&1`,
7577
true
7678
);
7779
if (output.trimEnd().endsWith("Everything up-to-date") && !monorepo) {

newCommands/envvar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function envvar_key(pathToOrganization, organizationId, serviceGroupId, key, sec
9595
}
9696
async function envvar_new(pathToOrganization, organizationId, serviceGroupId) {
9797
try {
98-
const key = await shortText("Key", "Key for the key-value pair", "key").then();
98+
const key = await shortText("Key", "Key for the key-value pair", "DB").then();
9999
return envvar_key(pathToOrganization, organizationId, serviceGroupId, key, true, true, true);
100100
}
101101
catch (e) {

0 commit comments

Comments
 (0)