File: fix_build.diff

package info (click to toggle)
node-node-sass 7.0.3%2Bgit20221109.ee13eb9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 75,492 kB
  • sloc: javascript: 7,311; cpp: 1,495; perl: 428; makefile: 11
file content (25 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: build flags should not be set to empty string by default
Author: Jérémy Lal <kapouer@melix.org>
Forwarded: https://github.com/sass/node-sass/pull/2718
Last-Update: 2019-08-12
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -55,10 +55,14 @@
  */
 
 function build(options) {
-  var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat(
-    ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) {
-      return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join('');
-    })).concat(options.args);
+  var libargs = [];
+  ['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].forEach(function(subject) {
+    var env = process.env[subject.toUpperCase()];
+    if (env != null) libargs.push(['--', subject, '=', env].join(''));
+  });
+  var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose']
+    .concat(libargs)
+    .concat(options.args);
 
   console.log('Building:', [process.execPath].concat(args).join(' '));