Skip to content

Commit

Permalink
Add rdb files as a submodule (#64)
Browse files Browse the repository at this point in the history
* Add rdb files as a submodule

* Try to fix disk space issue
  • Loading branch information
kivutar authored Oct 19, 2018
1 parent d6cf7f3 commit c07194c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = assets
url = https://github.com/kivutar/ludo-assets.git
branch = master
[submodule "database"]
path = database
url = https://github.com/kivutar/ludo-database.git
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $(BUNDLENAME).app: ludo
mkdir -p $(BUNDLENAME).app/Contents/Resources/$(BUNDLENAME).iconset
cp pkg/Info.plist $(BUNDLENAME).app/Contents/
echo "APPL????" > $(BUNDLENAME).app/Contents/PkgInfo
cp -r database $(BUNDLENAME).app/Contents/Resources
cp -r assets $(BUNDLENAME).app/Contents/Resources
sips -z 16 16 assets/icon.png --out $(BUNDLENAME).app/Contents/Resources/$(BUNDLENAME).iconset/icon_16x16.png
sips -z 32 32 assets/icon.png --out $(BUNDLENAME).app/Contents/Resources/$(BUNDLENAME).iconset/[email protected]
Expand All @@ -24,7 +25,7 @@ $(BUNDLENAME).app: ludo

empty.dmg:
mkdir -p template
hdiutil create -fs HFSX -layout SPUD -size 40m empty.dmg -srcfolder template -format UDRW -volname $(BUNDLENAME) -quiet
hdiutil create -fs HFSX -layout SPUD -size 200m empty.dmg -srcfolder template -format UDRW -volname $(BUNDLENAME) -quiet
rmdir template

$(BUNDLENAME).dmg: empty.dmg $(BUNDLENAME).app
Expand Down
1 change: 1 addition & 0 deletions database
Submodule database added at d6f4f4
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func main() {
settings.Save()
}

state.Global.DB, err = scanner.LoadDB("/Users/kivutar/libretro-database/rdb/")
state.Global.DB, err = scanner.LoadDB("database/")
if err != nil {
log.Println("Can't load game database:", err)
}
Expand Down
4 changes: 4 additions & 0 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os/user"
"path/filepath"
"strconv"
"strings"

"github.com/libretro/ludo/notifications"
"github.com/libretro/ludo/rdb"
Expand All @@ -23,6 +24,9 @@ func LoadDB(dir string) (rdb.DB, error) {
}
db := make(rdb.DB)
for _, f := range files {
if !strings.Contains(f.Name(), ".rdb") {
continue
}
filename := f.Name()
system := filename[0 : len(filename)-4]
bytes, _ := ioutil.ReadFile(dir + f.Name())
Expand Down

0 comments on commit c07194c

Please sign in to comment.