Skip to content

Commit

Permalink
give a directory argument to update-desktop-database because the script
Browse files Browse the repository at this point in the history
is called in an environment where the xdg_data_dirs is not defined which
leads to the directory we are interested in to not be considered
  • Loading branch information
seb128 committed Aug 3, 2016
1 parent 1939d7c commit eb0a8c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wrappers/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func updateDesktopDatabase(desktopFiles []string) error {
}

if _, err := exec.LookPath("update-desktop-database"); err == nil {
if output, err := exec.Command("update-desktop-database").CombinedOutput(); err != nil {
if output, err := exec.Command("update-desktop-database", dirs.SnapDesktopFilesDir).CombinedOutput(); err != nil {
return fmt.Errorf("cannot update-desktop-database %q: %s", output, err)
}
logger.Debugf("update-desktop-database successful")
Expand Down
4 changes: 2 additions & 2 deletions wrappers/desktop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (s *desktopSuite) TestAddPackageDesktopFiles(c *C) {
c.Assert(err, IsNil)
c.Assert(osutil.FileExists(expectedDesktopFilePath), Equals, true)
c.Assert(s.mockUpdateDesktopDatabase.Calls(), DeepEquals, [][]string{
{"update-desktop-database"},
{"update-desktop-database", dirs.SnapDesktopFilesDir},
})
}

Expand All @@ -99,7 +99,7 @@ func (s *desktopSuite) TestRemovePackageDesktopFiles(c *C) {
c.Assert(err, IsNil)
c.Assert(osutil.FileExists(mockDesktopFilePath), Equals, false)
c.Assert(s.mockUpdateDesktopDatabase.Calls(), DeepEquals, [][]string{
{"update-desktop-database"},
{"update-desktop-database", dirs.SnapDesktopFilesDir},
})
}

Expand Down

0 comments on commit eb0a8c9

Please sign in to comment.