Skip to content

Instantly share code, notes, and snippets.

@mohsin
Created November 30, 2016 08:47
Show Gist options
  • Save mohsin/1e303b78f3fab46c3fb06fbc39d59463 to your computer and use it in GitHub Desktop.
Save mohsin/1e303b78f3fab46c3fb06fbc39d59463 to your computer and use it in GitHub Desktop.
Plugin public-private repo issue solution
#!/bin/sh
remote="$1"
url="$2"
message=$(git log -1 HEAD --pretty=format:%s)
public_repo="/Users/Moz/Desktop/public"
[ -d lang ] && yes | cp -rf lang/* $public_repo/lang
[ -d updates ] && yes | cp -rf updates/* $public_repo/updates
cd $public_repo
if [ ! -z "$(git status --porcelain)" ]; then
echo "\nCommitting and pushing public repo"
git commit -am "$message"
git push origin master
echo "Successfully updated public repo, continuing...\n"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment