@kazuph/herdr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/herdr +36 -0
  2. package/package.json +15 -0
package/bin/herdr ADDED
@@ -0,0 +1,36 @@
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ launcher=$0
5
+ while [ -L "$launcher" ]; do
6
+ launcher_dir=$(CDPATH= cd -- "$(dirname -- "$launcher")" && pwd)
7
+ target=$(readlink "$launcher")
8
+ case "$target" in
9
+ /*) launcher=$target ;;
10
+ *) launcher=$launcher_dir/$target ;;
11
+ esac
12
+ done
13
+ package_dir=$(CDPATH= cd -- "$(dirname -- "$launcher")/.." && pwd)
14
+ case "$(uname -s)" in
15
+ Darwin) os=darwin ;;
16
+ Linux) os=linux ;;
17
+ *)
18
+ echo "@kazuph/herdr does not support $(uname -s)/$(uname -m)" >&2
19
+ exit 1
20
+ ;;
21
+ esac
22
+ case "$(uname -m)" in
23
+ arm64|aarch64) cpu=arm64 ;;
24
+ x86_64|amd64) cpu=x64 ;;
25
+ *)
26
+ echo "@kazuph/herdr does not support $os/$(uname -m)" >&2
27
+ exit 1
28
+ ;;
29
+ esac
30
+
31
+ binary="$package_dir/../herdr-$os-$cpu/bin/herdr"
32
+ if [ ! -x "$binary" ]; then
33
+ echo "@kazuph/herdr could not load @kazuph/herdr-$os-$cpu; reinstall @kazuph/herdr" >&2
34
+ exit 1
35
+ fi
36
+ exec "$binary" "$@"
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@kazuph/herdr",
3
+ "version": "0.1.0",
4
+ "description": "Kazuph Herdr launcher",
5
+ "license": "AGPL-3.0-or-later",
6
+ "repository": "https://github.com/kazuph/herdr",
7
+ "bin": { "herdr": "bin/herdr" },
8
+ "files": ["bin/herdr"],
9
+ "optionalDependencies": {
10
+ "@kazuph/herdr-darwin-arm64": "0.1.0",
11
+ "@kazuph/herdr-darwin-x64": "0.1.0",
12
+ "@kazuph/herdr-linux-arm64": "0.1.0",
13
+ "@kazuph/herdr-linux-x64": "0.1.0"
14
+ }
15
+ }