forked from vercel/nft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-install.js
24 lines (20 loc) · 1.04 KB
/
prepare-install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { unlinkSync, readFileSync, writeFileSync } = require('fs');
const { join } = require('path');
const isWin = process.platform === 'win32';
if (isWin) {
const pkgJson = readFileSync(join(__dirname, 'package.json'), 'utf8');
const pkg = JSON.parse(pkgJson);
//unlinkSync(join(__dirname, 'yarn.lock'));
// Delete the integration tests that will never work in Windows
unlinkSync(join(__dirname, 'test', 'integration', 'tensorflow.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'argon2.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'highlights.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'hot-shots.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'loopback.js'));
unlinkSync(join(__dirname, 'test', 'integration', 'playwright-core.js'));
delete pkg.devDependencies['@tensorflow/tfjs-node'];
delete pkg.devDependencies['argon2'];
delete pkg.devDependencies['highlights'];
delete pkg.devDependencies['hot-shots'];
writeFileSync(join(__dirname, 'package.json'), JSON.stringify(pkg));
}