niieani / bash-oo-framework

Bash Infinity is a modern standard library / framework / boilerplate for Bash
https://github.com/niieani/bash-oo-framework/discussions
MIT License
5.57k stars 247 forks source link

Cannot import lib/types/base/Var.sh #7

Closed avdv closed 8 years ago

avdv commented 8 years ago

I'm using Bash 4.3.42(1)-release and just checked out the project.

Trying to call ./oo.sh results in:

 ✘ UNCAUGHT EXCEPTION: Manually invoked
## 58
    ➦ Cannot import /src/bash-oo-framework/lib/types/base/Var.sh [06_system.sh:53]
    ✘ [ ! -e "$libPath" ] && throw "Cannot import $libPath" && return 1 [06_system.sh:53]
## 1
       import Var [Array.sh:1]
## 19
          ➦ source "$libPath" || throw "Unable to load $libPath" [06_system.sh:19]
## 66
             ➦ System.LoadFile "$file" [06_system.sh:66]
## 9
                ➦ System.Import [oo.sh:4]
                ✘ import lib/types/base [oo.sh:4]

 ⚡ Press [CTRL+C] to exit or [Return] to continue execution.
niieani commented 8 years ago

Is the cloned bash-oo-framework in /src/bash-oo-framework? If so, do you have permissions to all the cloned files (i.e. if you cloned as root / sudo, are you running as root / sudo?).

avdv commented 8 years ago

Is the cloned bash-oo-framework in /src/bash-oo-framework? If so, do you have permissions to all the cloned files (i.e. if you cloned as root / sudo, are you running as root / sudo?).

Yes, all files are owned by the same user, I did not invoke git as root - no sudo involved.

avdv commented 8 years ago

What puzzled me, is that it tries to import lib/types/base/Var.sh but there's only lib/types/var.sh (lower case and in another directory).

niieani commented 8 years ago

Ah, I see the bug now. Array imports Var, and that file does not exist cause it's var. I've renamed it to Var.sh to confirm with other types. Those types should be in /lib/types/base/. Try pulling now.