about summary refs log tree commit diff stats
path: root/wiki/inc/lang/id/edit.txt
blob: a32803c445f5f55961ac171728a1508b349ababf (plain) (blame)
1
2
Ubah isi halaman kemudian tekan "Simpan". Lihat [[wiki:syntax]] untuk sintaks-sintaks Wiki. Mohon edit/ubah halaman sesuai dengan judul halamannya. Bila Anda masih ragu untuk menulis di halaman ini, silahkan bermain-main di [[playground:playground|tamanbermain]].
e.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
// +build linux netbsd openbsd freebsd dragonfly

package storage

import (
	"fmt"
	"os"
)

// GetDir returns grus data directory. Check if the user has set
// XDG_DATA_HOME is set & if that is not set then assume it to be the
// default value which is $HOME/.local/share according to XDG Base
// Directory Specification.
func GetDir() string {
	cacheDir := SysDir()

	// Grus cache directory is cacheDir/grus.
	grusCacheDir := fmt.Sprintf("%s/%s", cacheDir,
		"grus")

	return grusCacheDir
}

// SysDir returns the system data directory, this is useful for unveil in
// OpenBSD.
func SysDir() string {
	if len(cacheDir) == 0 {
		cacheDir = os.Getenv("XDG_DATA_HOME")
	}
	if len(cacheDir) == 0 {
		cacheDir = fmt.Sprintf("%s/%s/%s", os.Getenv("HOME"),
			".local", "share")
	}

	return cacheDir
}