mirror of
https://github.com/VSCodium/vscodium.git
synced 2024-12-23 08:52:43 +03:00
31 lines
444 B
Bash
Executable File
31 lines
444 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# All common functions can be added to this file
|
|
|
|
exists() { type -t "$1" &> /dev/null; }
|
|
|
|
is_gnu_sed () {
|
|
sed --version &> /dev/null
|
|
}
|
|
|
|
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
|