forked from EsupPortail/esup-publisher
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conf: provide a way to sahre git hooks and some requirments for the p…
…roject
- Loading branch information
1 parent
8deb519
commit e3a5b10
Showing
23 changed files
with
1,223 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if applypatch-msg is defined, skip if not | ||
has_hook_script applypatch-msg || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" applypatch-msg || { | ||
echo | ||
echo "applypatch-msg hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if commit-msg is defined, skip if not | ||
has_hook_script commit-msg || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" commit-msg || { | ||
echo | ||
echo "commit-msg hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-applypatch is defined, skip if not | ||
has_hook_script post-applypatch || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-applypatch || { | ||
echo | ||
echo "post-applypatch hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-checkout is defined, skip if not | ||
has_hook_script post-checkout || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-checkout || { | ||
echo | ||
echo "post-checkout hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-commit is defined, skip if not | ||
has_hook_script post-commit || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-commit || { | ||
echo | ||
echo "post-commit hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-merge is defined, skip if not | ||
has_hook_script post-merge || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-merge || { | ||
echo | ||
echo "post-merge hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-receive is defined, skip if not | ||
has_hook_script post-receive || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-receive || { | ||
echo | ||
echo "post-receive hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
#yorkie 2.0.0 | ||
|
||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
has_hook_script () { | ||
[ -f package.json ] && cat package.json | grep -q "\"$1\"[[:space:]]*:" | ||
} | ||
|
||
# OS X and Linux only | ||
load_nvm () { | ||
# If nvm is not loaded, load it | ||
command_exists nvm || { | ||
export NVM_DIR="$1" | ||
[ -s "$1/nvm.sh" ] && . "$1/nvm.sh" | ||
} | ||
} | ||
|
||
# OS X and Linux only | ||
run_nvm () { | ||
# If nvm has been loaded correctly, use project .nvmrc | ||
command_exists nvm && [ -f .nvmrc ] && nvm use | ||
} | ||
|
||
cd "." | ||
|
||
# Check if post-rewrite is defined, skip if not | ||
has_hook_script post-rewrite || exit 0 | ||
|
||
# Add common path where Node can be found | ||
# Brew standard installation path /usr/local/bin | ||
# Node standard installation path /usr/local | ||
export PATH="$PATH:/usr/local/bin:/usr/local" | ||
|
||
# Try to load nvm using path of standard installation | ||
load_nvm /home/${USER}/.nvm | ||
run_nvm | ||
|
||
# Export Git hook params | ||
export GIT_PARAMS="$*" | ||
|
||
# Run hook | ||
node "./node_modules/yorkie/src/runner.js" post-rewrite || { | ||
echo | ||
echo "post-rewrite hook failed (add --no-verify to bypass)" | ||
exit 1 | ||
} |
Oops, something went wrong.