We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e17cc7b commit 98ab36dCopy full SHA for 98ab36d
1 file changed
src/bb-logger.sh
@@ -85,8 +85,14 @@ log::init()
85
{
86
local fileName="${1:-"debug"}"
87
88
- [[ ! -d "$BB_LOG_DIR" ]] && { mkdir -p "$BB_LOG_DIR" || return 1; }
89
- [[ ! -f "$BB_LOG_DIR/$fileName" ]] && { touch "$BB_LOG_DIR/$fileName" || return 1; }
+ if [[ "${fileName:0:1}" != "/" ]]; then
+ [[ ! -d "$BB_LOG_DIR" ]] && { mkdir -p "$BB_LOG_DIR" || return 1; }
90
+ [[ ! -f "$BB_LOG_DIR/$fileName" ]] && { touch "$BB_LOG_DIR/$fileName" || return 1; }
91
+ else
92
+ local fileDir="${fileName%/*}"
93
+ [[ ! -d "$fileDir" ]] && { mkdir -p "$fileDir" || return 1; }
94
+ [[ ! -f "$fileName" ]] && { touch "$fileName" || return 1; }
95
+ fi
96
97
return 0
98
}
0 commit comments