File tree Expand file tree Collapse file tree 1 file changed +25
-11
lines changed
Expand file tree Collapse file tree 1 file changed +25
-11
lines changed Original file line number Diff line number Diff line change 3636}
3737
3838check_dependencies () {
39- local deps=(" rpm-build" " go" " pandoc" " make" " git" )
40- local missing=()
41-
42- for dep in " ${deps[@]} " ; do
43- if ! command -v " $dep " & > /dev/null; then
44- missing+=(" $dep " )
39+ # Command name -> Package name mapping for Fedora
40+ declare -A deps=(
41+ [" rpmbuild" ]=" rpm-build"
42+ [" go" ]=" golang"
43+ [" pandoc" ]=" pandoc"
44+ [" make" ]=" make"
45+ [" git" ]=" git"
46+ )
47+ local missing_cmds=()
48+ local missing_pkgs=()
49+
50+ for cmd in " ${! deps[@]} " ; do
51+ if ! command -v " $cmd " & > /dev/null; then
52+ missing_cmds+=(" $cmd " )
53+ missing_pkgs+=(" ${deps[$cmd]} " )
4554 fi
4655 done
4756
48- if [ ${# missing[@]} -ne 0 ]; then
49- echo -e " ${RED} Error: Missing dependencies: ${missing[*]}${NC} "
50- echo -e " ${YELLOW} Install on Fedora:${NC} "
51- echo " sudo dnf install -y rpm-build golang pandoc make git"
57+ if [ ${# missing_cmds[@]} -ne 0 ]; then
58+ echo -e " ${RED} Error: Missing required commands: ${missing_cmds[*]}${NC} "
59+ echo
60+ echo -e " ${YELLOW} These commands are required but not found in your PATH.${NC} "
61+ echo
62+ echo -e " ${YELLOW} To install on Fedora:${NC} "
63+ echo " sudo dnf install -y ${missing_pkgs[*]} "
64+ echo
65+ echo -e " ${YELLOW} If packages are already installed, ensure the commands are in your PATH.${NC} "
5266 exit 1
5367 fi
5468}
@@ -84,7 +98,7 @@ show_info() {
8498 echo " .rpmmacros: $HOME /.rpmmacros"
8599 echo
86100
87- # Try to get version
101+ # Get version
88102 local version=$( get_version " " )
89103 echo " Version Information:"
90104 echo " Current version: $version "
You can’t perform that action at this time.
0 commit comments