Lab 1
This commit is contained in:
14
exam/common.js
Normal file
14
exam/common.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import fs from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
export function installDeps() {
|
||||
// check if node_modules exists
|
||||
if (fs.existsSync('./node_modules')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// install dependencies
|
||||
console.log('Installing dependencies...');
|
||||
execSync('npm install', { stdio: 'inherit' });
|
||||
console.log('Dependencies installed');
|
||||
}
|
||||
Reference in New Issue
Block a user