Skip to content

Instantly share code, notes, and snippets.

@nodesocket
Created January 29, 2013 21:45
Show Gist options
  • Select an option

  • Save nodesocket/4668211 to your computer and use it in GitHub Desktop.

Select an option

Save nodesocket/4668211 to your computer and use it in GitHub Desktop.
<?php
$domains_path = "/srv/www/domains";
$full_path = $domains_path . "/commando.io";
$repo = "git@github.com:nodesocket/commando.io.git";
if(is_dir($full_path)) {
exec("cd $full_path && git pull");
echo '{"pull":true}';
} else {
exec("cd $domains_path && git clone $repo");
echo '{"clone":true}';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment