@mittwald/cli 1.13.1-beta.8 → 1.13.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.
- package/dist/commands/app/exec.js +2 -2
- package/dist/commands/app/ssh.js +2 -2
- package/dist/commands/container/exec.js +2 -2
- package/dist/commands/container/ssh.js +2 -2
- package/dist/commands/ddev/init.js +2 -0
- package/dist/commands/project/ssh.js +2 -2
- package/dist/lib/ddev/config_builder.js +1 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
2
|
import { Args, Flags } from "@oclif/core";
|
|
3
3
|
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
|
|
4
4
|
import { sshConnectionFlags } from "../../lib/resources/ssh/flags.js";
|
|
@@ -61,7 +61,7 @@ export default class Exec extends ExtendedBaseCommand {
|
|
|
61
61
|
});
|
|
62
62
|
const wrappedExecCommand = shellEscape(["/bin/bash", "-c", execCommand]);
|
|
63
63
|
this.debug("running ssh %o, with command %o", sshArgs, wrappedExecCommand);
|
|
64
|
-
const result =
|
|
64
|
+
const result = spawnSync("/usr/bin/ssh", [...sshArgs, wrappedExecCommand], {
|
|
65
65
|
stdio: "inherit",
|
|
66
66
|
});
|
|
67
67
|
if (result.status !== 0) {
|
package/dist/commands/app/ssh.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
2
|
import { appInstallationArgs } from "../../lib/resources/app/flags.js";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
4
|
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
|
|
@@ -55,7 +55,7 @@ export default class Ssh extends ExtendedBaseCommand {
|
|
|
55
55
|
if (flags.cd) {
|
|
56
56
|
this.log("changing to %o; use --no-cd to disable this behaviour", directory);
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
spawnSync("/usr/bin/ssh", [...args, cmd], {
|
|
59
59
|
stdio: "inherit",
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
2
|
import { Args, Flags } from "@oclif/core";
|
|
3
3
|
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
|
|
4
4
|
import { getSSHConnectionForContainer } from "../../lib/resources/ssh/container.js";
|
|
@@ -72,7 +72,7 @@ export default class Exec extends ExtendedBaseCommand {
|
|
|
72
72
|
});
|
|
73
73
|
const wrappedExecCommand = shellEscape([flags.shell, "-c", execCommand]);
|
|
74
74
|
this.debug("running ssh %o, with command %o", sshArgs, wrappedExecCommand);
|
|
75
|
-
const result =
|
|
75
|
+
const result = spawnSync("/usr/bin/ssh", [...sshArgs, wrappedExecCommand], {
|
|
76
76
|
stdio: "inherit",
|
|
77
77
|
});
|
|
78
78
|
if (result.status !== 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
2
|
import { Args, Flags } from "@oclif/core";
|
|
3
3
|
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
|
|
4
4
|
import { getSSHConnectionForContainer } from "../../lib/resources/ssh/container.js";
|
|
@@ -44,7 +44,7 @@ export default class Ssh extends ExtendedBaseCommand {
|
|
|
44
44
|
this.log("connecting to %o as %o", host, user);
|
|
45
45
|
const [cmd, args] = buildSSHCmdAndFlags(user, host, flags);
|
|
46
46
|
this.debug("running ssh %o, with command %o", args, cmd);
|
|
47
|
-
|
|
47
|
+
spawnSync("/usr/bin/ssh", [...args, cmd], {
|
|
48
48
|
stdio: "inherit",
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -138,6 +138,7 @@ export class Init extends ExecRenderBaseCommand {
|
|
|
138
138
|
const parsed = load(existing);
|
|
139
139
|
const alreadyContainsAPIToken = (parsed.web_environment ?? []).some((e) => e.startsWith("MITTWALD_API_TOKEN="));
|
|
140
140
|
if (!alreadyContainsAPIToken) {
|
|
141
|
+
// eslint-disable-next-line camelcase
|
|
141
142
|
parsed.web_environment = [
|
|
142
143
|
...(parsed.web_environment ?? []),
|
|
143
144
|
`MITTWALD_API_TOKEN=${token}`,
|
|
@@ -148,6 +149,7 @@ export class Init extends ExecRenderBaseCommand {
|
|
|
148
149
|
catch (err) {
|
|
149
150
|
if (isNotFound(err)) {
|
|
150
151
|
const config = {
|
|
152
|
+
// eslint-disable-next-line camelcase
|
|
151
153
|
web_environment: [`MITTWALD_API_TOKEN=${token}`],
|
|
152
154
|
};
|
|
153
155
|
await writeContentsToFile(configFile, dump(config));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
2
|
import { projectArgs } from "../../lib/resources/project/flags.js";
|
|
3
3
|
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
|
|
4
4
|
import { sshConnectionFlags } from "../../lib/resources/ssh/flags.js";
|
|
@@ -16,7 +16,7 @@ export default class Ssh extends ExtendedBaseCommand {
|
|
|
16
16
|
const projectId = await this.withProjectId(Ssh);
|
|
17
17
|
const { user, host } = await getSSHConnectionForProject(this.apiClient, projectId, this.flags["ssh-user"]);
|
|
18
18
|
this.log("connecting to %o as %o", host, user);
|
|
19
|
-
|
|
19
|
+
spawnSync("/usr/bin/ssh", ["-l", user, host], {
|
|
20
20
|
stdio: "inherit",
|
|
21
21
|
});
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/cli",
|
|
3
|
-
"version": "1.13.1
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"description": "Hand-crafted CLI for the mittwald API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"compile": "tsc --build tsconfig.json",
|
|
27
27
|
"format": "yarn format:prettier --write",
|
|
28
28
|
"format:prettier": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}'",
|
|
29
|
-
"generate:readme": "oclif readme --multi --output-dir=docs < /dev/null",
|
|
29
|
+
"generate:readme": "oclif readme --multi --output-dir=docs < /dev/null && sed -i -e '/See code: .src/d' docs/*.md",
|
|
30
30
|
"license-check": "yarn pnpify license-checker-rseidelsohn ",
|
|
31
31
|
"lint": "eslint . --cache",
|
|
32
32
|
"package": "yarn package:tarballs && yarn package:windows && yarn package:macos",
|