-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1534d9
commit 367fc19
Showing
7 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
commit-message: | ||
prefix: "deps:" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "09:00" | ||
- package-ecosystem: "github-actions" | ||
commit-message: | ||
prefix: "ci:" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "09:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: '0 0 * * 0' # run "At 00:00 on Sunday" | ||
|
||
# See https://github.com/cristalhq/.github/.github/workflows | ||
jobs: | ||
build: | ||
uses: cristalhq/.github/.github/workflows/[email protected] | ||
|
||
vuln: | ||
uses: cristalhq/.github/.github/workflows/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Guide for osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,50 @@ | ||
# osx | ||
# osx | ||
|
||
[![build-img]][build-url] | ||
[![pkg-img]][pkg-url] | ||
[![reportcard-img]][reportcard-url] | ||
[![coverage-img]][coverage-url] | ||
[![version-img]][version-url] | ||
|
||
TODO | ||
|
||
## Features | ||
|
||
* Simple API. | ||
|
||
See [GUIDE.md](https://github.com/cristalhq/osx/blob/main/GUIDE.md) for more details. | ||
|
||
## Install | ||
|
||
Go version 1.18+ | ||
|
||
``` | ||
go get github.com/cristalhq/osx | ||
``` | ||
|
||
## Example | ||
|
||
```go | ||
TODO | ||
``` | ||
|
||
Also see examples: [example_test.go](https://github.com/cristalhq/osx/blob/main/example_test.go). | ||
|
||
## Documentation | ||
|
||
See [these docs][pkg-url]. | ||
|
||
## License | ||
|
||
[MIT License](LICENSE). | ||
|
||
[build-img]: https://github.com/cristalhq/osx/workflows/build/badge.svg | ||
[build-url]: https://github.com/cristalhq/osx/actions | ||
[pkg-img]: https://pkg.go.dev/badge/cristalhq/osx | ||
[pkg-url]: https://pkg.go.dev/github.com/cristalhq/osx | ||
[reportcard-img]: https://goreportcard.com/badge/cristalhq/osx | ||
[reportcard-url]: https://goreportcard.com/report/cristalhq/osx | ||
[coverage-img]: https://codecov.io/gh/cristalhq/osx/branch/main/graph/badge.svg | ||
[coverage-url]: https://codecov.io/gh/cristalhq/osx | ||
[version-img]: https://img.shields.io/github/v/release/cristalhq/osx | ||
[version-url]: https://github.com/cristalhq/osx/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package osx_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/cristalhq/osx | ||
|
||
go 1.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package osx | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
// IsFile reports wheter file exists. | ||
func IsFile(filename string) bool { | ||
return exists(filename, false) | ||
} | ||
|
||
// IsDir reports wheter directory exists. | ||
func IsDir(dirname string) bool { | ||
return exists(dirname, true) | ||
} | ||
|
||
func exists(name string, dir bool) bool { | ||
switch info, err := os.Stat(name); { | ||
case os.IsNotExist(err): | ||
return false | ||
case dir: | ||
return info.IsDir() | ||
default: | ||
return !info.IsDir() | ||
} | ||
} |