Skip to content

Commit

Permalink
replace source with dot for POSIX compliance #32
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmysun committed Aug 26, 2024
1 parent 5dd0f73 commit e985c0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions ell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ ELL_VERSION="0.1.1";
BASE_DIR=$(dirname "${0}");

# logging_debug "Importing helper functions";
source "${BASE_DIR}/helpers/logging.sh";
source "${BASE_DIR}/helpers/parse_arguments.sh";
source "${BASE_DIR}/helpers/load_config.sh";
source "${BASE_DIR}/helpers/piping.sh";
. "${BASE_DIR}/helpers/logging.sh";
. "${BASE_DIR}/helpers/parse_arguments.sh";
. "${BASE_DIR}/helpers/load_config.sh";
. "${BASE_DIR}/helpers/piping.sh";

logging_debug "Starting ${0}";

Expand Down Expand Up @@ -52,7 +52,7 @@ load_config;

parse_arguments "${@}";

source "${BASE_DIR}/llm_backends/generate_completion.sh";
. "${BASE_DIR}/llm_backends/generate_completion.sh";

# Deciding where to output
if [[ ${ELL_OUTPUT_FILE} != "-" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions helpers/load_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ function load_config() {
set -o allexport;
if [[ -f "${HOME}/.ellrc" ]]; then
logging_debug "Loading config from ${HOME}/.ellrc (from \$HOME)";
source "${HOME}/.ellrc"
. "${HOME}/.ellrc"
fi

if [[ -f "${PWD}/.ellrc" ]]; then
logging_debug "Loading config from ${PWD}/.ellrc (from \$PWD)";
source "${PWD}/.ellrc"
. "${PWD}/.ellrc"
fi

if [[ -z "${ELL_CONFIG}" ]]; then
logging_debug "ELL_CONFIG is not set";
else
if [[ -f "${ELL_CONFIG}" ]]; then
logging_debug "Loading config from ${ELL_CONFIG}";
source "${ELL_CONFIG}"
. "${ELL_CONFIG}"
else
logging_fatal "Config file ${ELL_CONFIG} not found";
exit 1;
Expand Down
2 changes: 1 addition & 1 deletion llm_backends/generate_completion.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

# Sourcing the generate_completion.sh script according to the selected API style
source "$(dirname ${0})/llm_backends/${ELL_API_STYLE}/generate_completion.sh";
. "$(dirname ${0})/llm_backends/${ELL_API_STYLE}/generate_completion.sh";
2 changes: 1 addition & 1 deletion tests/piping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function inc() {

export -f inc;

source "$(dirname "${0}")/../helpers/piping.sh";
. "$(dirname "${0}")/../helpers/piping.sh";

head -c 256 < /dev/zero | tr '\0' '0' | piping inc inc inc inc inc inc inc inc inc inc inc inc;

Expand Down

0 comments on commit e985c0a

Please sign in to comment.