X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;h=6f447a74b79e4d07bfbba3cf677a2f182bf4d9de;hb=1dc3dbef58dc69388eb842d17dc61be75c098ba3;hp=88f3d315032f2283bc5d24108606fec98be8bcb3;hpb=7381dff08b01e224a5c8c9e99b7d3bc317efdb98;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 88f3d315..6f447a74 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -319,6 +319,29 @@ if [ -z "$skip_all" ]; then regenerate } + function add_cygwin_drive_mounts() { + for i in c d e f g h q z ; do + ln -s /cygdrive/$i $i + done + } + + + # takes a file to modify, and then it will replace any occurrences of the + # pattern provided as the second parameter with the text in the third + # parameter. + function replace_pattern_in_file() + { + local file="$1"; shift + local pattern="$1"; shift + local replacement="$1"; shift + if [ -z "$file" -o -z "$pattern" -o -z "$replacement" ]; then + echo "replace_pattern_in_file: needs a filename, a pattern to replace, and the" + echo "text to replace that pattern with." + return 1 + fi + sed -i -e "s/$pattern/$replacement/" "$file" + } + function function_sentinel() { return 0; } if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi