File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
import cp = require( 'child_process' )
2
2
import fs = require( 'fs' )
3
3
import p = require( 'path' )
4
+ import os = require( 'os' )
4
5
5
6
// Logger
6
7
const l = ( msg : string ) : void => console . log ( `husky - ${ msg } ` )
@@ -80,6 +81,19 @@ ${cmd}
80
81
)
81
82
82
83
l ( `created ${ file } ` )
84
+
85
+ if ( os . type ( ) === 'Windows_NT' ) {
86
+ l (
87
+ `Due to a limitation on Windows systems, the executable bit of the file cannot be set without using git.
88
+ To fix this, the file ${ file } has been automatically moved to the staging environment and the executable bit has been set using git.
89
+ Note that, if you remove the file from the staging environment, the executable bit will be removed.
90
+ You can add the file back to the staging environment and include the executable bit using the command 'git update-index -add --chmod=+x ${ file } '.
91
+ If you have already committed the file, you can add the executable bit using 'git update-index --chmod=+x ${ file } '.
92
+ You will have to commit the file to have git keep track of the executable bit.` ,
93
+ )
94
+
95
+ git ( [ 'update-index' , '--add' , '--chmod=+x' , file ] )
96
+ }
83
97
}
84
98
85
99
// Create a hook if it doesn't exist or append command to it
You can’t perform that action at this time.
0 commit comments