UNPKG

667 BJavaScriptView Raw
1#!/usr/bin/env node
2
3/* Post-install script for the linter */
4
5// Import the node modules
6const fs = require('fs');
7const path = require('path');
8
9// Create the symbolic link to a file
10const createLink = (file) => {
11
12 // Resolve the paths for the file
13 const package = path.resolve(__dirname, file);
14 const project = path.resolve(process.env.INIT_CWD, file);
15
16 // Check that the file does not exists in the project folder
17 if (!fs.existsSync(project)) {
18
19 // Create a symbolic link to the file in the project folder
20 fs.symlinkSync(package, project);
21 }
22}
23
24// Create the symbolic links to the files
25createLink('.eslintignore');
26createLink('.eslintrc.js');
\No newline at end of file