Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
5e7a5ca9
Commit
5e7a5ca9
authored
Apr 24, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: look in share_dir/config/ for providers.json; fix find_config_file to check config/ subdir
parent
c6f39ebc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
47 deletions
+44
-47
aisbf.sh
aisbf.sh
+18
-19
aisbf.sh
aisbf/aisbf.sh
+18
-19
config.py
aisbf/config.py
+8
-9
No files found.
aisbf.sh
View file @
5e7a5ca9
...
...
@@ -73,31 +73,30 @@ fi
mkdir
-p
"
$LOG_DIR
"
# Function to find the aisbf.json config file
# Checks user config first, then installed locations, then source tree
# Checks user config first, then installed locations
(config/ subdir first, then root)
, then source tree
find_config_file
()
{
# Check user config first (~/.aisbf/aisbf.json)
if
[
-f
"
$HOME
/.aisbf/aisbf.json"
]
;
then
echo
"
$HOME
/.aisbf/aisbf.json"
return
fi
# Check installed locations
if
[
-f
"/usr/share/aisbf/aisbf.json"
]
;
then
echo
"/usr/share/aisbf/aisbf.json"
return
fi
if
[
-f
"
$HOME
/.local/share/aisbf/aisbf.json"
]
;
then
echo
"
$HOME
/.local/share/aisbf/aisbf.json"
return
fi
# Check source tree config
if
[
-f
"
$SHARE_DIR
/config/aisbf.json"
]
;
then
echo
"
$SHARE_DIR
/config/aisbf.json"
return
fi
# Check installed share locations — config/ subdir takes priority over root
for
dir
in
\
"
$SHARE_DIR
/config"
\
"
$SHARE_DIR
"
\
"
$HOME
/.local/share/aisbf/config"
\
"
$HOME
/.local/share/aisbf"
\
"/usr/local/share/aisbf/config"
\
"/usr/local/share/aisbf"
\
"/usr/share/aisbf/config"
\
"/usr/share/aisbf"
;
do
if
[
-f
"
$dir
/aisbf.json"
]
;
then
echo
"
$dir
/aisbf.json"
return
fi
done
# Not found
echo
""
}
...
...
aisbf/aisbf.sh
View file @
5e7a5ca9
...
...
@@ -73,31 +73,30 @@ fi
mkdir
-p
"
$LOG_DIR
"
# Function to find the aisbf.json config file
# Checks user config first, then installed locations, then source tree
# Checks user config first, then installed locations
(config/ subdir first, then root)
, then source tree
find_config_file
()
{
# Check user config first (~/.aisbf/aisbf.json)
if
[
-f
"
$HOME
/.aisbf/aisbf.json"
]
;
then
echo
"
$HOME
/.aisbf/aisbf.json"
return
fi
# Check installed locations
if
[
-f
"/usr/share/aisbf/aisbf.json"
]
;
then
echo
"/usr/share/aisbf/aisbf.json"
return
fi
if
[
-f
"
$HOME
/.local/share/aisbf/aisbf.json"
]
;
then
echo
"
$HOME
/.local/share/aisbf/aisbf.json"
return
fi
# Check source tree config
if
[
-f
"
$SHARE_DIR
/config/aisbf.json"
]
;
then
echo
"
$SHARE_DIR
/config/aisbf.json"
return
fi
# Check installed share locations — config/ subdir takes priority over root
for
dir
in
\
"
$SHARE_DIR
/config"
\
"
$SHARE_DIR
"
\
"
$HOME
/.local/share/aisbf/config"
\
"
$HOME
/.local/share/aisbf"
\
"/usr/local/share/aisbf/config"
\
"/usr/local/share/aisbf"
\
"/usr/share/aisbf/config"
\
"/usr/share/aisbf"
;
do
if
[
-f
"
$dir
/aisbf.json"
]
;
then
echo
"
$dir
/aisbf.json"
return
fi
done
# Not found
echo
""
}
...
...
aisbf/config.py
View file @
5e7a5ca9
...
...
@@ -346,19 +346,18 @@ class Config:
if
(
self
.
_custom_config_dir
/
'providers.json'
)
.
exists
():
return
self
.
_custom_config_dir
# Try installed locations in order of preference
# 1. User-local installation (pip install --user)
# 2. System-wide installation (sudo pip install)
# 3. Alternative system location
installed_dirs
=
[
# Try installed locations in order of preference.
# Check both share_dir/config/ (current layout) and share_dir/ (legacy).
share_roots
=
[
Path
.
home
()
/
'.local'
/
'share'
/
'aisbf'
,
Path
(
'/usr/local/share/aisbf'
),
Path
(
'/usr/share/aisbf'
),
]
for
installed_dir
in
installed_dirs
:
if
installed_dir
.
exists
()
and
(
installed_dir
/
'providers.json'
)
.
exists
():
return
installed_dir
for
root
in
share_roots
:
for
candidate
in
(
root
/
'config'
,
root
):
if
candidate
.
exists
()
and
(
candidate
/
'providers.json'
)
.
exists
():
return
candidate
# Fallback to source tree config directory
# This is for development mode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment