Skip to content

Commit 2979d20

Browse files
author
Ahmed Elshaabany
committed
Modify package.json file
1 parent cc2680f commit 2979d20

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

script.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +0,0 @@
1-
#!/usr/bin/env node
2-
3-
const execSync = require('child_process').execSync;
4-
const fs = require('fs');
5-
const path = require('path');
6-
7-
/**
8-
* Use Yarn if available, it's much faster than the npm client.
9-
* Return the version of yarn installed on the system, null if yarn is not available.
10-
*/
11-
function getYarnVersionIfAvailable() {
12-
let yarnVersion;
13-
try {
14-
// execSync returns a Buffer -> convert to string
15-
yarnVersion = (execSync('yarn --version', {
16-
stdio: [0, 'pipe', 'ignore'],
17-
}).toString() || '').trim();
18-
} catch (error) {
19-
return null;
20-
}
21-
return yarnVersion;
22-
}
23-
24-
function installDevDependencies() {
25-
console.log('Adding dev dependencies for the project...');
26-
27-
if (getYarnVersionIfAvailable()) {
28-
execSync(`yarn install`, { stdio: 'inherit' });
29-
} else {
30-
execSync(`npm install`);
31-
}
32-
}
33-
34-
installDevDependencies();
35-
createScripts();
36-
37-
console.log("This is post init script");

0 commit comments

Comments
 (0)