File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,21 @@ private async Task RunHook(string hook, string args = null)
50
50
return ;
51
51
}
52
52
53
+ var execPermissionOutput = await ProcessUtil . QuickRun ( "bash" ,
54
+ $ "-c \" if [[ -x { hook } ]]; then echo 'true'; else echo 'false'; fi\" ", false ) ;
55
+
56
+ if ( execPermissionOutput . ExitCode != 0 ||
57
+ ! bool . TryParse ( execPermissionOutput . Output , out var isExecutable ) ||
58
+ ! isExecutable )
59
+ {
60
+ await ProcessUtil . QuickRun ( "chmod" , $ "+x { hook } ") ;
61
+ }
62
+
53
63
_logger . LogDebug ( "Executing hook '{hook}'" , hook ) ;
54
- await ProcessUtil . QuickRun ( "chmod" , $ "+x { hook } ") ;
55
64
var hookRun = await ProcessUtil . QuickRun ( hook , args , false ) ;
65
+ var a = new FileInfo ( hook ) ;
66
+
67
+
56
68
if ( string . IsNullOrWhiteSpace ( hookRun . Output ) )
57
69
_logger . LogDebug ( "Hook '{hook}' completed with exit code {exitCode}." , hook , hookRun . ExitCode ) ;
58
70
else
You can’t perform that action at this time.
0 commit comments