mirror of
https://github.com/VSCodium/vscodium
synced 2024-10-30 03:47:40 +00:00
30 lines
443 B
Bash
Executable file
30 lines
443 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# All common functions can be added to this file
|
|
|
|
exists() { type -t "$1" > /dev/null 2>&1; }
|
|
|
|
is_gnu_sed () {
|
|
sed --version >/dev/null 2>&1
|
|
}
|
|
|
|
replace () {
|
|
echo "${1}"
|
|
if is_gnu_sed; then
|
|
sed -i -E "${1}" "${2}"
|
|
else
|
|
sed -i '' -E "${1}" "${2}"
|
|
fi
|
|
}
|
|
|
|
if ! exists gsed; then
|
|
if is_gnu_sed; then
|
|
function gsed() {
|
|
sed -i -E "$@"
|
|
}
|
|
else
|
|
function gsed() {
|
|
sed -i '' -E "$@"
|
|
}
|
|
fi
|
|
fi
|