@@ -463,7 +463,7 @@ connect_repo() {
463463
464464# src/lib/download_repo.sh
465465download_repo () {
466- find_config
466+ find_config || return 1
467467
468468 if [[ ! -f $rc_file ]]; then
469469 echo " Cannot find $rc_file "
@@ -493,15 +493,15 @@ find_config() {
493493 echo " You should either:"
494494 echo " - Run this command in a folder with 'alf.conf' file, or"
495495 echo " - Run 'alf connect' to properly connect to a remote config"
496- exit 1
496+ return 1
497497 fi
498498}
499499
500500# src/lib/generate_completion.sh
501501generate_completions () {
502502 ali1_regex=" ^([a-zA-Z0-9\-]+):"
503503 ali2_regex=" ^ +([a-zA-Z0-9\-]+):"
504- find_config
504+ find_config || return 1
505505
506506 echo ' # Completions'
507507 echo ' if command -v complete &> /dev/null ; then'
@@ -535,7 +535,7 @@ generate_config() {
535535 state=" simple"
536536 lastcmd=" "
537537 case_open=" false"
538- find_config
538+ find_config || return 1
539539
540540 echo " # This file was automatically generated by alf"
541541 echo " # https://github.com/dannyben/alf"
@@ -626,7 +626,7 @@ generate_last_cmd() {
626626# src/lib/has_subcommands.sh
627627has_subcommands () {
628628 regex=" ^ +([a-zA-Z0-9\-]+):"
629- find_config
629+ find_config || return 1
630630
631631 while IFS= read -r line || [ -n " $line " ]; do
632632 if [[ $line =~ $regex ]]; then
@@ -658,7 +658,7 @@ prompt_to_continue() {
658658
659659# src/lib/save_config.sh
660660save_config () {
661- find_config
661+ find_config || return 1
662662
663663 tilde=' ~'
664664 friendly_aliases_file=" ${aliases_file/# $HOME / $tilde } "
@@ -676,7 +676,7 @@ show_alias_command() {
676676 local subcode=" ${2:- } "
677677 local regex_exact_code regex_exact_subcode cmd1 cmd2
678678
679- find_config
679+ find_config || return 1
680680 regex_exact_code=" ^($code ): *(.+)$"
681681 regex_exact_subcode=" ^( +)($subcode ): *(.+)$"
682682 cmd1=" "
@@ -707,7 +707,7 @@ show_alias_command() {
707707
708708# src/lib/show_info.sh
709709show_info () {
710- find_config
710+ find_config || return 1
711711
712712 if [[ -d " $repo_path /.git" ]]; then
713713 pushd " $repo_path " > /dev/null
@@ -753,7 +753,7 @@ show_info() {
753753
754754# src/lib/upload_repo.sh
755755upload_repo () {
756- find_config
756+ find_config || return 1
757757
758758 if [[ ! -f $rc_file ]]; then
759759 echo " Cannot find $rc_file "
@@ -1455,7 +1455,7 @@ alf_info_parse_requirements() {
14551455
14561456# :command.initialize
14571457initialize () {
1458- declare -g version=" 0.6.1 "
1458+ declare -g version=" 0.7.0 "
14591459 set -eo pipefail
14601460
14611461 # src/initialize.sh
0 commit comments