mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Break main dotify binary apart into smaller pieces for easier testing
The plan is to have a build script that will put together all files into a single executable again for easy inclusion in your own dotfiles. Breaking dotify apart simply makes it easier to work with and test.
This commit is contained in:
13
src/lib/trim.sh
Normal file
13
src/lib/trim.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
# Trim leading and trailing whitespace.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# $ trim " foo bar "
|
||||
# foo bar
|
||||
#
|
||||
trim() {
|
||||
local string="$@"
|
||||
string="${string#"${string%%[![:space:]]*}"}"
|
||||
string="${string%"${string##*[![:space:]]}"}"
|
||||
echo -n "$string"
|
||||
}
|
||||
Reference in New Issue
Block a user