forked from vercel/nft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-install.js
23 lines (19 loc) · 983 Bytes
/
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
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'));
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));
}