File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const os = require('os')
5
5
const ini = require ( 'ini' )
6
6
const utils = require ( '../lib/utils' )
7
7
const loggerFactory = require ( './loggerFactory' )
8
- const logger = loggerFactory . get ( 'install' )
8
+ let logger
9
9
10
10
function enableHook ( hookFullPath , homeDir ) {
11
11
let npmrc = path . join ( homeDir , '.npmrc' )
@@ -20,11 +20,14 @@ function enableHook(hookFullPath, homeDir) {
20
20
function hookSetup ( ) {
21
21
const homeDir = os . homedir ( )
22
22
const datreeioDir = utils . getDatreeioDir ( )
23
+
24
+ try {
25
+ fs . mkdirSync ( datreeioDir )
26
+ } catch ( err ) { }
27
+
28
+ logger = loggerFactory . get ( 'install' )
23
29
try {
24
30
const hookFullPath = `${ datreeioDir } /hook.js`
25
- try {
26
- fs . mkdirSync ( datreeioDir )
27
- } catch ( err ) { }
28
31
29
32
const hookData = fs . readFileSync ( path . join ( __dirname , 'hook.js' ) )
30
33
fs . writeFileSync ( hookFullPath , hookData )
You can’t perform that action at this time.
0 commit comments