File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,9 +50,21 @@ private async Task RunHook(string hook, string args = null)
5050 return ;
5151 }
5252
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+
5363 _logger . LogDebug ( "Executing hook '{hook}'" , hook ) ;
54- await ProcessUtil . QuickRun ( "chmod" , $ "+x { hook } ") ;
5564 var hookRun = await ProcessUtil . QuickRun ( hook , args , false ) ;
65+ var a = new FileInfo ( hook ) ;
66+
67+
5668 if ( string . IsNullOrWhiteSpace ( hookRun . Output ) )
5769 _logger . LogDebug ( "Hook '{hook}' completed with exit code {exitCode}." , hook , hookRun . ExitCode ) ;
5870 else
You can’t perform that action at this time.
0 commit comments