This file contains hidden or 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
#!/bin/sh | |
CWD=`pwd -P` | |
TARGET_FILE=$0 | |
cd `dirname $TARGET_FILE` | |
TARGET_FILE=`basename $TARGET_FILE` | |
# iterate down a (possible) chain of symlinks | |
while [ -L "$TARGET_FILE" ] |
This file contains hidden or 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
#!/bin/sh | |
FROM=$1 | |
TO=$2 | |
TEMP=$(mktemp -d) | |
echo Moving "$FROM" to "$TO" | |
git filter-branch -f --tree-filter "if [[ -e '$FROM' ]]; then mkdir -p "$(dirname $TO)"; mv '$FROM/' '$TEMP'; mv '$TEMP/' '$TO/'; fi" --tag-name-filter cat --prune-empty -- --all |
This file contains hidden or 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
# base64url encode | |
function base64url_encode { | |
(if [ -z "$1" ]; then cat -; else echo -n "$1"; fi) | | |
openssl base64 -e -A | | |
sed s/\\+/-/g | | |
sed s/\\//_/g | | |
sed -E s/=+$// | |
} | |
# base64url decode |