-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix: truffle unbox
use spawnSync
to run the post-install hook
#5765
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import download from "download-git-repo"; | |
import axios from "axios"; | ||
import vcsurl from "vcsurl"; | ||
import { parse as parseURL } from "url"; | ||
import { execSync } from "child_process"; | ||
import { spawnSync } from "child_process"; | ||
import inquirer from "inquirer"; | ||
import type { Question } from "inquirer"; | ||
import type { boxConfig, unboxOptions } from "typings"; | ||
|
@@ -148,7 +148,12 @@ function installBoxDependencies({ hooks }: boxConfig, destination: string) { | |
const postUnpack = hooks["post-unpack"]; | ||
|
||
if (postUnpack.length === 0) return; | ||
execSync(postUnpack, { cwd: destination, stdio: "ignore" }); | ||
|
||
spawnSync(postUnpack, { | ||
cwd: destination, | ||
shell: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm concerned there's no sanitization checks on this arbitrary command as noted in the docs
|
||
stdio: ["ignore", process.stdout, process.stderr] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore
|
||
}); | ||
} | ||
|
||
export = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow to run complex commands without parsing. ref: #5765 (comment)