@tobos/cli 0.4.6 → 0.4.7
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/tobos.js +9 -9
- package/package.json +1 -1
package/dist/tobos.js
CHANGED
|
@@ -58062,7 +58062,7 @@ function settings() {
|
|
|
58062
58062
|
|
|
58063
58063
|
// src/api.ts
|
|
58064
58064
|
init_out();
|
|
58065
|
-
var VERSION = true ? "0.4.
|
|
58065
|
+
var VERSION = true ? "0.4.7" : "dev";
|
|
58066
58066
|
function newer(a, b) {
|
|
58067
58067
|
const parse9 = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n2) => parseInt(n2)) : null;
|
|
58068
58068
|
const x = parse9(a);
|
|
@@ -58730,14 +58730,14 @@ async function runCheck(dir2) {
|
|
|
58730
58730
|
}
|
|
58731
58731
|
var remoteLines = (stderr) => stderr.split("\n").filter((l) => l.startsWith("remote: ")).map((l) => l.slice(8));
|
|
58732
58732
|
var plural = (n2, word) => `${n2} ${word}${n2 === 1 ? "" : "s"}`;
|
|
58733
|
+
var MEDIA_LIMIT = /^tobos: (This deck belongs to .+, whose )?Tobos \w+ keeps .+ of media/;
|
|
58733
58734
|
function pushFailure(output, remote) {
|
|
58735
|
+
const forThePerson = `${remote.map((line) => line.replace(/^tobos: /, "")).join("\n")}
|
|
58736
|
+
${ASK_THE_PERSON}`;
|
|
58734
58737
|
if (remote.some((line) => /^tobos: This (deck|template) is archived/.test(line)))
|
|
58735
|
-
return {
|
|
58736
|
-
|
|
58737
|
-
|
|
58738
|
-
exit: EXIT.limit,
|
|
58739
|
-
archived: true
|
|
58740
|
-
};
|
|
58738
|
+
return { message: forThePerson, exit: EXIT.limit, archived: true };
|
|
58739
|
+
if (remote.some((line) => MEDIA_LIMIT.test(line)))
|
|
58740
|
+
return { message: forThePerson, exit: EXIT.limit, limit: "media" };
|
|
58741
58741
|
if (/non-fast-forward|fetch first/.test(output))
|
|
58742
58742
|
return {
|
|
58743
58743
|
message: "The server has changes you don't have. Run `tobos pull` (or `git pull`), then push again.",
|
|
@@ -58832,8 +58832,8 @@ async function pushWorkingCopy(out, deck, message) {
|
|
|
58832
58832
|
);
|
|
58833
58833
|
const remote = remoteLines(pushed.stderr);
|
|
58834
58834
|
if (pushed.code !== 0) {
|
|
58835
|
-
const { message: message2, exit,
|
|
58836
|
-
throw new CliError(message2, exit,
|
|
58835
|
+
const { message: message2, exit, ...extra } = pushFailure(pushed.stdout + pushed.stderr, remote);
|
|
58836
|
+
throw new CliError(message2, exit, { remote, ...extra });
|
|
58837
58837
|
}
|
|
58838
58838
|
const rev = (await gitOk(["rev-parse", "HEAD"], { cwd: root })).trim();
|
|
58839
58839
|
return { ok: true, rev, committed, uploaded, warnings: warnings2, remote };
|