AppManager is now loading database from command line argument

This commit is contained in:
Solene Rapenne 2022-07-04 12:10:53 +02:00
parent bf316d3ef2
commit e0f7b381a6
3 changed files with 9 additions and 4 deletions

View File

@ -2,4 +2,4 @@ db:
python3 ./build_json.py > src/pkg.json
run: db
godot --path src/
godot --path src/ -- ${PWD}/src/pkg.json

View File

@ -1,3 +1,7 @@
#!/bin/sh
/usr/local/bin/godot --src /usr/local/share/AppManager/project.godot
DB=$(mktemp -t appmgr_db.XXXXXXXXXXXXXX)
python3 /usr/local/share/AppManager/build_json.py > "$DB"
/usr/local/bin/godot --src /usr/local/share/AppManager/project.godot -- "$DB"
rm "$DB"

View File

@ -28,9 +28,10 @@ func get_installed_packages():
func _ready():
get_installed_packages()
# the last parameter is a path to the packages database
var db_path = OS.get_cmdline_args()[-1]
var file = File.new()
file.open("pkg.json", File.READ)
file.open(db_path, File.READ)
var content_as_text = file.get_as_text()
data = parse_json(content_as_text)
$Panel/LineEdit.grab_focus()