Exemple #1
0
// snapCommonDataDirs returns the list of data directories common between versions of the given snap
func snapCommonDataDirs(snap *snap.Info) ([]string, error) {
	// collect the directories, homes first
	found, err := filepath.Glob(snap.CommonDataHomeDir())
	if err != nil {
		return nil, err
	}
	// then system data
	found = append(found, snap.CommonDataDir())

	return found, nil
}
Exemple #2
0
// snapCommonDataDirs returns the list of data directories common between versions of the given snap
func snapCommonDataDirs(snap *snap.Info) ([]string, error) {
	// collect the directories, homes first
	found, err := filepath.Glob(snap.CommonDataHomeDir())
	if err != nil {
		return nil, err
	}

	// then XDG_RUNTIME_DIRs for the users
	foundXdg, err := filepath.Glob(snap.XdgRuntimeDirs())
	if err != nil {
		return nil, err
	}
	found = append(found, foundXdg...)

	// then system data
	found = append(found, snap.CommonDataDir())

	return found, nil
}