winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

pre-commit-wrapper.sh (585B)


      1 #!/bin/sh
      2 #
      3 # Copyright (c) Microsoft Corporation.
      4 # Licensed under the MIT License.
      5 #
      6 # A wrapper script to call the pre-commit.sh script
      7 #
      8 # Since git hooks are not committed to the server, existing only
      9 # in the .git folder, this will be copied there and call the actual
     10 # hook script only in case it exists. This should prevent issues
     11 # with the user having to work on an earlier commit that does not
     12 # have the hook or its dependencies installed.
     13 
     14 root_dir=$(git rev-parse --show-toplevel)
     15 hook_script="$root_dir/pre-commit.sh"
     16 if [[ -f $hook_script ]]; then
     17 	. "$hook_script"
     18 fi