Skip to content

Instantly share code, notes, and snippets.

@bramblex
Last active January 29, 2023 08:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bramblex/a6b12543a076e2c1fa5acecb95f51ead to your computer and use it in GitHub Desktop.
Save bramblex/a6b12543a076e2c1fa5acecb95f51ead to your computer and use it in GitHub Desktop.
mweb-auto-publish.sh
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