@mittwald/cli 1.9.0 → 1.9.1
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
const hook = async function (opts) {
|
|
3
|
+
const isInstalledWithBrew = () => {
|
|
4
|
+
try {
|
|
5
|
+
const cellar = execSync("brew --cellar", { encoding: "utf8" });
|
|
6
|
+
return opts.config.root.startsWith(cellar);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
if (opts.Command.id === "update") {
|
|
13
|
+
if (isInstalledWithBrew()) {
|
|
14
|
+
opts.context.warn("installed with brew.\nUse `brew upgrade mw` to update to the newest version");
|
|
15
|
+
opts.context.exit(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export default hook;
|
|
@@ -3,7 +3,7 @@ import { cwd } from "process";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { pathExists } from "../util/fs/pathExists.js";
|
|
5
5
|
function overrideIDFromState(state, type) {
|
|
6
|
-
const instances = state.resources?.find((r) => r.type === type)?.instances;
|
|
6
|
+
const instances = state.resources?.find((r) => r.type === type && r.mode === "managed")?.instances;
|
|
7
7
|
if (instances === undefined) {
|
|
8
8
|
return undefined;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BooleanFlag, OptionFlag } from "@oclif/core/interfaces";
|
|
2
2
|
import { ListColumns } from "./Table.js";
|
|
3
|
-
export { ListColumn, ListColumns } from "./Table.js";
|
|
3
|
+
export type { ListColumn, ListColumns } from "./Table.js";
|
|
4
4
|
type ListFormatterFlags = {
|
|
5
5
|
output: OptionFlag<OutputFormat>;
|
|
6
6
|
extended: BooleanFlag<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/cli",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Hand-crafted CLI for the mittwald API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -281,6 +281,9 @@
|
|
|
281
281
|
"bucket": "mittwald-cli",
|
|
282
282
|
"host": "https://mittwald-cli.s3.eu-central-1.amazonaws.com"
|
|
283
283
|
}
|
|
284
|
+
},
|
|
285
|
+
"hooks": {
|
|
286
|
+
"prerun": "./dist/hooks/prerun/update-brew-check"
|
|
284
287
|
}
|
|
285
288
|
},
|
|
286
289
|
"packageManager": "yarn@3.6.1"
|