@rpcbase/cli 0.191.0 → 0.192.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/package.json +1 -1
- package/src/cmd-deploy/index.js +9 -3
- package/src/cmd-ssh.js +9 -3
package/package.json
CHANGED
package/src/cmd-deploy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execSync } from "child_process"
|
|
1
|
+
import { execFileSync, execSync } from "child_process"
|
|
2
2
|
import fs from "fs"
|
|
3
3
|
import os from "os"
|
|
4
4
|
import path from "path"
|
|
@@ -246,9 +246,15 @@ export const deploy = async (argv) => {
|
|
|
246
246
|
let preparedDeploy = null
|
|
247
247
|
|
|
248
248
|
const ssh = async (command, stdioInherit = false) => {
|
|
249
|
-
const sshCommand = `ssh -i "${keyPath}" -o StrictHostKeyChecking=no ${user}@${host} "${command}"`
|
|
250
249
|
log(`${command}`)
|
|
251
|
-
const out =
|
|
250
|
+
const out = execFileSync("ssh", [
|
|
251
|
+
"-i",
|
|
252
|
+
keyPath,
|
|
253
|
+
"-o",
|
|
254
|
+
"StrictHostKeyChecking=no",
|
|
255
|
+
`${user}@${host}`,
|
|
256
|
+
command,
|
|
257
|
+
], {
|
|
252
258
|
stdio: (argv.verbose || stdioInherit) ? "inherit" : "pipe",
|
|
253
259
|
})
|
|
254
260
|
const res = out?.toString()?.trim() || ""
|
package/src/cmd-ssh.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "child_process"
|
|
2
2
|
import fs from "fs"
|
|
3
3
|
import path from "path"
|
|
4
4
|
import os from "os"
|
|
@@ -45,9 +45,15 @@ export const ssh = async (argv) => {
|
|
|
45
45
|
let tempKeyPath = null
|
|
46
46
|
|
|
47
47
|
const execSsh = async (command, stdioInherit = true) => {
|
|
48
|
-
const sshCommand = `ssh -i "${keyPath}" -o StrictHostKeyChecking=no ${user}@${host} "${command}"`
|
|
49
48
|
log(`${command}`)
|
|
50
|
-
const out =
|
|
49
|
+
const out = execFileSync("ssh", [
|
|
50
|
+
"-i",
|
|
51
|
+
keyPath,
|
|
52
|
+
"-o",
|
|
53
|
+
"StrictHostKeyChecking=no",
|
|
54
|
+
`${user}@${host}`,
|
|
55
|
+
command,
|
|
56
|
+
], {
|
|
51
57
|
stdio: (argv.verbose || stdioInherit) ? "inherit" : "pipe",
|
|
52
58
|
})
|
|
53
59
|
const res = out?.toString()?.trim() || ""
|