mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 14:20:29 -04:00
Remove trailing slash from dir name in GitHub web hook
This commit is contained in:
parent
bd4dd7baa2
commit
d58ac00ce3
1 changed files with 4 additions and 4 deletions
|
@ -59,17 +59,17 @@ try{
|
|||
}
|
||||
|
||||
// Get the filesystem path for the ebook ID.
|
||||
$dir = REPOS_PATH . '/' . $repoName . '.git/';
|
||||
$dir = REPOS_PATH . '/' . $repoName . '.git';
|
||||
|
||||
// Confirm we're looking at a Git repo in our filesystem
|
||||
if(!file_exists($dir . 'HEAD')){
|
||||
if(!file_exists($dir . '/HEAD')){
|
||||
// We might be looking for a repo whose name is so long, it was truncated for GitHub. Try to check that here by simply globbing the rest.
|
||||
$dirs = glob(REPOS_PATH . '/' . $repoName . '*');
|
||||
if(sizeof($dirs) == 1){
|
||||
$dir = rtrim($dirs[0], '/') . '/';
|
||||
$dir = rtrim($dirs[0], '/');
|
||||
}
|
||||
|
||||
if(!file_exists($dir . 'HEAD')){
|
||||
if(!file_exists($dir . '/HEAD')){
|
||||
throw new WebhookException('Couldn\'t find repo "' . $repoName . '" in filesystem at "' . $dir . '".', $post);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue