diff options
| -rw-r--r-- | meta/classes/npm.bbclass | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 05bb9f578d..547c531883 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
| @@ -61,8 +61,8 @@ def npm_pack(env, srcdir, workdir): | |||
| 61 | """Run 'npm pack' on a specified directory""" | 61 | """Run 'npm pack' on a specified directory""" |
| 62 | import shlex | 62 | import shlex |
| 63 | cmd = "npm pack %s" % shlex.quote(srcdir) | 63 | cmd = "npm pack %s" % shlex.quote(srcdir) |
| 64 | configs = [("ignore-scripts", "true")] | 64 | args = [("ignore-scripts", "true")] |
| 65 | tarball = env.run(cmd, configs=configs, workdir=workdir).strip("\n") | 65 | tarball = env.run(cmd, args=args, workdir=workdir).strip("\n") |
| 66 | return os.path.join(workdir, tarball) | 66 | return os.path.join(workdir, tarball) |
| 67 | 67 | ||
| 68 | python npm_do_configure() { | 68 | python npm_do_configure() { |
| @@ -228,15 +228,11 @@ python npm_do_compile() { | |||
| 228 | 228 | ||
| 229 | bb.utils.remove(d.getVar("NPM_BUILD"), recurse=True) | 229 | bb.utils.remove(d.getVar("NPM_BUILD"), recurse=True) |
| 230 | 230 | ||
| 231 | env = NpmEnvironment(d, configs=npm_global_configs(d)) | ||
| 232 | |||
| 233 | dev = bb.utils.to_boolean(d.getVar("NPM_INSTALL_DEV"), False) | ||
| 234 | |||
| 235 | with tempfile.TemporaryDirectory() as tmpdir: | 231 | with tempfile.TemporaryDirectory() as tmpdir: |
| 236 | args = [] | 232 | args = [] |
| 237 | configs = [] | 233 | configs = npm_global_configs(d) |
| 238 | 234 | ||
| 239 | if dev: | 235 | if bb.utils.to_boolean(d.getVar("NPM_INSTALL_DEV"), False): |
| 240 | configs.append(("also", "development")) | 236 | configs.append(("also", "development")) |
| 241 | else: | 237 | else: |
| 242 | configs.append(("only", "production")) | 238 | configs.append(("only", "production")) |
| @@ -254,6 +250,8 @@ python npm_do_compile() { | |||
| 254 | configs.append(("nodedir", d.getVar("NPM_NODEDIR"))) | 250 | configs.append(("nodedir", d.getVar("NPM_NODEDIR"))) |
| 255 | configs.append(("python", d.getVar("PYTHON"))) | 251 | configs.append(("python", d.getVar("PYTHON"))) |
| 256 | 252 | ||
| 253 | env = NpmEnvironment(d, configs) | ||
| 254 | |||
| 257 | # Add node-pre-gyp configuration | 255 | # Add node-pre-gyp configuration |
| 258 | args.append(("target_arch", d.getVar("NPM_ARCH"))) | 256 | args.append(("target_arch", d.getVar("NPM_ARCH"))) |
| 259 | args.append(("build-from-source", "true")) | 257 | args.append(("build-from-source", "true")) |
