aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-01-24 11:18:29 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-01-24 11:18:29 +0100
commit40b95e145faf8781cbb12215c07a62c846c214fe (patch)
tree925d1ede98884aff19bfb0c87986be0f438db5b5
parentworkflows: upgrade actions (diff)
parentREADME: update (diff)
downloadconfig-links-40b95e145faf8781cbb12215c07a62c846c214fe.tar.gz
config-links-40b95e145faf8781cbb12215c07a62c846c214fe.zip
Merge tag 'v2.0.2' into debian
Diffstat (limited to '')
-rw-r--r--.gitattributes2
-rw-r--r--.github/workflows/ci.yml17
-rw-r--r--README.md9
-rw-r--r--src/os.sh5
-rwxr-xr-xtest/test.sh4
5 files changed, 30 insertions, 7 deletions
diff --git a/.gitattributes b/.gitattributes
index 26a9424..78efe19 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,6 +2,8 @@
*.sh text eol=lf
+/links-* text eol=lf
+
/.github/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5c0cd21..f4954c4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,10 +7,23 @@ on:
jobs:
test:
- runs-on: ubuntu-latest
- name: Test
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ runs-on: '${{ matrix.os }}'
+ name: 'Test / ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v3
+
+ - name: Install dependencies
+ run: |
+ brew install bash coreutils findutils
+ echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH"
+ echo "$(brew --prefix)/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
+ if: runner.os == 'macOS'
+ # Is it even macOS anymore? It is for me. I really am too lazy to deal
+ # with ancient utilities that come with the actual macOS.
+
- name: Test
run: ./test/test.sh
diff --git a/README.md b/README.md
index 2ff362c..4247989 100644
--- a/README.md
+++ b/README.md
@@ -32,9 +32,11 @@ Installation
* For Arch Linux, use the [AUR package].
* For Ubuntu, use the [PPA].
* Alternatively, just checkout this repository.
+* For macOS, see [this section].
[AUR package]: https://aur.archlinux.org/packages/config-links/
[PPA]: https://launchpad.net/~egor-tensin/+archive/ubuntu/config-links
+[this section]: #macos
Usage
-----
@@ -110,6 +112,13 @@ allows) are not supported.
A special variable name `CONFIG_LINKS_ROOT` is resolved to the root path, "/".
+macOS
+-----
+
+macOS is supported on a basic level.
+GNU coreutils and findutils are required, which you can install using Homebrew.
+Don't forget to add them to PATH!
+
License
-------
diff --git a/src/os.sh b/src/os.sh
index 2f1b4bb..60c0f9a 100644
--- a/src/os.sh
+++ b/src/os.sh
@@ -5,11 +5,8 @@
# Mostly Cygwin-related stuff
-os="$( uname -o )"
-readonly os
-
is_cygwin() {
- test "$os" == 'Cygwin'
+ test "$OSTYPE" == 'cygwin'
}
check_symlinks_enabled_cygwin() {
diff --git a/test/test.sh b/test/test.sh
index f2abfde..05c5d65 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -32,7 +32,9 @@ new_test() {
echo ======================================================================
echo "New test: $test_name"
- test_root_dir="$( mktemp --directory )"
+ test_root_dir="$( mktemp -d )"
+ # mktemp returns /var/..., which is actually in /private/var/... on macOS.
+ test_root_dir="$( readlink -e -- "$test_root_dir" )"
test_src_dir="$test_root_dir/$src_dir_name"
test_dest_dir="$test_root_dir/$dest_dir_name"
test_alt_dest_dir="$test_root_dir/$alt_dest_dir_name"