Skip to content

Instantly share code, notes, and snippets.

View tkis's full-sized avatar
🎯
Focusing

Tomasz Kiszka tkis

🎯
Focusing
View GitHub Profile
@tkis
tkis / clean-branches.sh
Last active February 1, 2019 10:46
Git repo cleanup
#!/bin/bash
read -p "Are you sure? (y/n) " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
current_branch=`git rev-parse --abbrev-ref HEAD`
if [[ ${current_branch} != *"dev"* ]]; then
echo "Please checkout on dev branch first"
exit 1
fi
private fun restartApplication() {
val i = baseContext.packageManager.getLaunchIntentForPackage(baseContext.packageName)!!
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(i)
System.exit(0)
}