Skip to content

Commit f64ae25

Browse files
committed
shell format profile
1 parent 6b5e0e6 commit f64ae25

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trim_trailing_whitespace = true
1313
[*.py]
1414
indent_size = 4
1515

16-
[*.sh]
16+
[{*.sh,profile}]
1717
indent_size = 2
1818

1919
[*.{xml,htm,html,tmTheme}]

profile

+11-12
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ ENV_DEBUG=${ENV_DEBUG:-false}
55
_debug() {
66
# Utility to print debug messages
77
case "$ENV_DEBUG" in
8-
1|true|TRUE)
9-
printf "%b" "$( date +%Y-%m-%dT%H:%M:%S%z ) DEBUG "
10-
printf "%b" "$@"
11-
printf "%b" "\n"
12-
;;
13-
*) ;;
8+
1 | true | TRUE)
9+
printf "%b" "$(date +%Y-%m-%dT%H:%M:%S%z) DEBUG "
10+
printf "%b" "$@"
11+
printf "%b" "\n"
12+
;;
13+
*) ;;
1414
esac
1515
}
1616

1717
src() {
1818
# Utility to import configuration files
1919
if [ "$1" ]; then
20-
source_file="$HOME/.dotfiles/environment/$1.sh"
21-
_debug "Importing $source_file"
22-
if [ -f "$source_file" ]; then
20+
source_file="$HOME/.dotfiles/environment/$1.sh"
21+
_debug "Importing $source_file"
22+
if [ -f "$source_file" ]; then
2323
# shellcheck source=./environment/functions.sh
24-
. "$source_file"
24+
. "$source_file"
2525
else
2626
echo "ERROR: $source_file does not exist"
2727
fi
@@ -42,8 +42,7 @@ src "aliases"
4242

4343
# Find and import local configuration files
4444
# Anything in environment/*.local.sh will be imported here
45-
for local_env_source_file in $(find_local_config)
46-
do
45+
for local_env_source_file in $(find_local_config); do
4746
src "${local_env_source_file%.sh}"
4847
done
4948

0 commit comments

Comments
 (0)