Skip to content

Commit

Permalink
add a copyright notice with original author
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Oct 30, 2023
1 parent 6d8a40b commit ef034d0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/locker/runtime_darwin.go
Expand Up @@ -21,6 +21,10 @@ import (
"path/filepath"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentRunDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion internal/locker/runtime_unix.go
Expand Up @@ -24,10 +24,14 @@ import (
"strconv"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentRunDir() (string, error) {
run := filepath.Join("run", "user", strconv.Itoa(os.Getuid()))
if _, err := os.Stat(run); err == nil {
return run
return run, nil
}

Check warning on line 35 in internal/locker/runtime_unix.go

View check run for this annotation

Codecov / codecov/patch

internal/locker/runtime_unix.go#L31-L35

Added lines #L31 - L35 were not covered by tests

// /run/user/$uid is set by pam_systemd, but might not be present, especially in containerized environments
Expand Down
4 changes: 4 additions & 0 deletions internal/locker/runtime_windows.go
Expand Up @@ -23,6 +23,10 @@ import (
"golang.org/x/sys/windows"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentRunDir() (string, error) {
flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH}
for _, flag := range flags {
Expand Down
4 changes: 4 additions & 0 deletions pkg/remote/cache_darwin.go
Expand Up @@ -21,6 +21,10 @@ import (
"path/filepath"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentCacheDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/remote/cache_unix.go
Expand Up @@ -23,6 +23,10 @@ import (
"path/filepath"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentCacheDir() (string, error) {
home, err := os.UserHomeDir()
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions pkg/remote/cache_windows.go
Expand Up @@ -23,6 +23,10 @@ import (
"golang.org/x/sys/windows"
)

// Based on https://github.com/adrg/xdg
// Licensed under MIT License (MIT)
// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

func osDependentCacheDir() (string, error) {
flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH}
for _, flag := range flags {
Expand Down

0 comments on commit ef034d0

Please sign in to comment.