Skip to content

Commit 8da4bee

Browse files
committed
fix issue when resolving apps dir relative names
1 parent 8bb2945 commit 8da4bee

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/commands/update.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (cmd *UpdateCmd) Run(*Context) (err error) {
2929
for _, target := range cmd.Targets {
3030
entry, err := cmd.getRegistryEntry(target)
3131
if err != nil {
32-
println(err)
3332
continue
3433
}
3534

@@ -96,7 +95,7 @@ func getAllTargets() ([]string, error) {
9695
}
9796
registry.Update()
9897

99-
paths := make([]string, len(registry.Entries))
98+
var paths []string
10099
for k := range registry.Entries {
101100
paths = append(paths, k)
102101
}

app/utils/registry.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ func (registry *Registry) createEntryFromFile(filePath string) RegistryEntry {
119119
}
120120

121121
func (registry *Registry) Lookup(target string) (RegistryEntry, bool) {
122+
applicationsDir, _ := MakeApplicationsDirPath()
123+
possibleFullPath := filepath.Join(applicationsDir, target)
124+
122125
for _, entry := range registry.Entries {
123-
if entry.FileSha1 == target || entry.FilePath == target || entry.Repo == target {
126+
if entry.FileSha1 == target || entry.FilePath == target ||
127+
entry.FilePath == possibleFullPath || entry.Repo == target {
124128
return entry, true
125129
}
126130
}
@@ -131,10 +135,7 @@ func (registry *Registry) Lookup(target string) (RegistryEntry, bool) {
131135

132136
return entry, true
133137
} else {
134-
applicationsDir, _ := MakeApplicationsDirPath()
135-
target = filepath.Join(applicationsDir, target)
136-
137-
if IsAppImageFile(target) {
138+
if IsAppImageFile(possibleFullPath) {
138139
entry := registry.createEntryFromFile(target)
139140
_ = registry.Add(entry)
140141

0 commit comments

Comments
 (0)