Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
os: Visual Studio 2015
image: # http://www.appveyor.com/docs/appveyor-yml
- Visual Studio 2022

environment:
matrix:
- nodejs_version: 10
- nodejs_version: 12
- nodejs_version: 14
matrix: # https://github.com/nodejs/release#release-schedule
- nodejs_version: 16
- nodejs_version: 18
- nodejs_version: 20
- nodejs_version: 21

matrix: # TODO: Fix the `configures with unparsed options` tests and remove this allow_failures matrix.
allow_failures:
- nodejs_version: 20
- nodejs_version: 21

platform:
- x64
Expand All @@ -13,17 +20,19 @@ platform:
shallow_clone: true

install:
- ps: Install-Product node $env:nodejs_version $env:Platform
- ps: Install-Product node $env:nodejs_version $env:platform
- ps: Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
- npm config get
- node --version
- npm --version
- node -e "console.log(process.arch);"
- IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
- IF /I "%PLATFORM%" == "x86" SET PATH=C:\python27;%PATH%
- IF /I "%PLATFORM%" == "x64" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- IF /I "%PLATFORM%" == "x86" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- node -e "console.log(process.arch);" # 'x64' or 'ia32'
# Python >= v3.12 requires node-gyp >= v10
- IF /I "%PLATFORM%" == "x64" set PATH=C:\Python311-x64;%PATH%
- IF /I "%PLATFORM%" == "x86" SET PATH=C:\python311;%PATH%
- npm config list
- npm ci
- npm run update-crosswalk # To support newer versions of Node.js
# - npm audit # TODO: Fix mapbox/node-pre-gyp#705 and enable this line
- npm test

build: off
Expand Down
7 changes: 5 additions & 2 deletions lib/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = exports = clean;

exports.usage = 'Removes the entire folder containing the compiled .node module';

const rm = require('rimraf');
const { rimraf } = require('rimraf');
const exists = require('fs').exists || require('path').exists;
const versioning = require('./util/versioning.js');
const napi = require('./util/napi.js');
Expand All @@ -23,7 +23,10 @@ function clean(gyp, argv, callback) {
exists(to_delete, (found) => {
if (found) {
if (!gyp.opts.silent_clean) console.log('[' + package_json.name + '] Removing "%s"', to_delete);
return rm(to_delete, callback);
return rimraf(to_delete).then(
(result) => callback(null, result),
(err) => callback(err)
);
}
return callback();
});
Expand Down
8 changes: 4 additions & 4 deletions lib/util/napi.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ module.exports.get_napi_build_version_from_command_args = function(command_args)

module.exports.swap_build_dir_out = function(napi_build_version) {
if (napi_build_version) {
const rm = require('rimraf');
rm.sync(module.exports.get_build_dir(napi_build_version));
const { rimrafSync } = require('rimraf');
rimrafSync(module.exports.get_build_dir(napi_build_version));
fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
}
};

module.exports.swap_build_dir_in = function(napi_build_version) {
if (napi_build_version) {
const rm = require('rimraf');
rm.sync('build');
const { rimrafSync } = require('rimraf');
rimrafSync('build');
fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
}
};
Expand Down
Loading