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

Removes undefined variable #28

Closed nkakouros closed 6 years ago

nkakouros commented 6 years ago

local __oo__importParent="${__oo__importParent}"

I couldn't find where a global __oo__importParent could come from. Unless there is some bash hackery that I do not understand this shouldn't be needed. It currently breaks my scripts with an unbound variable error, as I set -x and then call import on some files.

Edit: I totally removed this variable as it was dead code. Did you have a use case for creating this variable?

niieani commented 6 years ago

The use case is when you want to import a remote file and that remote file then imports another file relative to it. You'd want to keep the parent directory, hence the "import parent" concept. A better way to fix this would be to fallback to an empty parent in case the variable is not set.

nkakouros commented 6 years ago

OK, got it. I think this is sufficient right?

Edit: I encountered 2 more undefined variables.

niieani commented 6 years ago

Thanks