mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-09-17 10:17:09 +03:00
add the ability to link extra files into the build directory
This commit is contained in:
parent
76c9c22bc6
commit
ecfce394df
@ -26,6 +26,12 @@ if __name__ == "__main__":
|
||||
"--bin-dir",
|
||||
help="Path to a node installation's binary directory. If present, will be treated as an extra entry in PATH for the duration of this command.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--extra-file",
|
||||
action="append",
|
||||
metavar="FILE=SRC",
|
||||
help="Add a file that the package needs, sourced from the given path. This may be used, for example, to add files needed by a prepublish script.",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@ -40,6 +46,16 @@ if __name__ == "__main__":
|
||||
shutil.copy(args.package, os.path.join(tempdir, "package.json"))
|
||||
shutil.copy(args.package_lock, os.path.join(tempdir, "package-lock.json"))
|
||||
|
||||
# grab extra files that may be needed
|
||||
for extra in args.extra_file or []:
|
||||
target, src = extra.split("=")
|
||||
|
||||
dir = os.path.dirname(target)
|
||||
if dir:
|
||||
os.makedirs(os.path.join(tempdir, dir))
|
||||
|
||||
os.symlink(os.path.abspath(src), os.path.join(tempdir, target))
|
||||
|
||||
cmd = ["npm", "clean-install", "--foreground-scripts"]
|
||||
|
||||
proc = subprocess.Popen(cmd, cwd=tempdir)
|
||||
|
Loading…
Reference in New Issue
Block a user