Last active
January 29, 2023 08:23
-
-
Save bramblex/a6b12543a076e2c1fa5acecb95f51ead to your computer and use it in GitHub Desktop.
mweb-auto-publish.sh
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
if (pbpaste | grep -Eq '^cd "[^"]*" && sh "[^"]*/site_publish_logs/sh_\d*\.sh" && open "[^"]*"') | |
then | |
echo "========== MWEB AUTO PUBLISH START ==========" | |
echo "Runing command:" | |
pbpaste | |
if pbpaste | sh | |
then | |
echo "Success!" | |
echo "Clean pasteboard..." | |
echo -n "" | pbcopy | |
echo "========== MWEB AUTO PUBLISH END ==========" | |
echo "Close terminal 5s later..." | |
sleep 5 | |
exit | |
else | |
echo "Failed!" | |
echo "Clean pasteboard..." | |
echo -n "" | pbcopy | |
echo "========== MWEB AUTO PUBLISH END ==========" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment