csskit 0.0.11 → 0.0.12
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.
- package/bin/csskit +34 -40
- package/package.json +7 -7
package/bin/csskit
CHANGED
|
@@ -2,55 +2,49 @@
|
|
|
2
2
|
set -e
|
|
3
3
|
|
|
4
4
|
SOURCE="${BASH_SOURCE[0]}"
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
|
|
6
|
+
|
|
7
|
+
# Resolve if bin is symlink; like `readlink -f`/`realpath` but cross-platform
|
|
5
8
|
while [ -L "$SOURCE" ]; do
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
TARGET="$(readlink "$SOURCE")"
|
|
10
|
+
case "$TARGET" in
|
|
11
|
+
/*) SOURCE="$TARGET" ;;
|
|
12
|
+
*) SOURCE="$SCRIPT_DIR/$TARGET" ;;
|
|
13
|
+
esac
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
|
|
12
15
|
done
|
|
13
16
|
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
MINGW* | MSYS* | CYGWIN*)
|
|
22
|
-
*)
|
|
23
|
-
echo "Unsupported platform: $(uname -s)" >&2
|
|
24
|
-
exit 1
|
|
25
|
-
;;
|
|
26
|
-
esac
|
|
27
|
-
|
|
28
|
-
# Detect architecture
|
|
29
|
-
case "$(uname -m)" in
|
|
30
|
-
x86_64 | amd64) ARCH="x64" ;;
|
|
31
|
-
aarch64 | arm64) ARCH="arm64" ;;
|
|
17
|
+
# Detect platform and architecture for sub-package path
|
|
18
|
+
case "$(uname -sm)" in
|
|
19
|
+
"Linux x86_64" | "Linux amd64") BIN="csskit-linux-x64/bin/csskit" ;;
|
|
20
|
+
"Linux aarch64" | "Linux arm64") BIN="csskit-linux-arm64/bin/csskit" ;;
|
|
21
|
+
"Darwin x86_64" | "Darwin amd64") BIN="csskit-darwin-x64/bin/csskit" ;;
|
|
22
|
+
"Darwin arm64") BIN="csskit-darwin-arm64/bin/csskit" ;;
|
|
23
|
+
MINGW*x86_64 | MINGW*amd64 | MSYS*x86_64 | MSYS*amd64 | CYGWIN*x86_64 | CYGWIN*amd64) BIN="csskit-win32-x64/bin/csskit.exe" ;;
|
|
24
|
+
MINGW*aarch64 | MINGW*arm64 | MSYS*aarch64 | MSYS*arm64 | CYGWIN*aarch64 | CYGWIN*arm64) BIN="csskit-win32-arm64/bin/csskit.exe" ;;
|
|
32
25
|
*)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
echo "Unsupported platform: $(uname -sm)" >&2
|
|
27
|
+
exit 1
|
|
28
|
+
;;
|
|
36
29
|
esac
|
|
37
30
|
|
|
38
|
-
#
|
|
39
|
-
|
|
31
|
+
# Walk up directory tree to find node_modules with the binary
|
|
32
|
+
CURRENT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
33
|
+
while [ "$CURRENT_DIR" != "/" ]; do
|
|
34
|
+
# Skip if parent directory is named node_modules to avoid nested node_modules paths
|
|
35
|
+
if [ "$(basename "$CURRENT_DIR")" != "node_modules" ]; then
|
|
36
|
+
BIN_PATH="${CURRENT_DIR}/node_modules/${BIN}"
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
BIN_PATH="${SCRIPT_DIR}/../node_modules/${PACKAGE_NAME}/bin/csskit"
|
|
46
|
-
fi
|
|
38
|
+
if [ -f "$BIN_PATH" ]; then
|
|
39
|
+
exec "$BIN_PATH" "$@"
|
|
40
|
+
fi
|
|
41
|
+
fi
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
fi
|
|
43
|
+
CURRENT_DIR="$(dirname "$CURRENT_DIR")"
|
|
44
|
+
done
|
|
51
45
|
|
|
52
46
|
# Binary not found
|
|
53
|
-
echo "Error: csskit binary not found for ${
|
|
47
|
+
echo "Error: csskit binary not found for ${BIN%%/*}" >&2
|
|
54
48
|
echo "Please ensure the appropriate platform package is installed:" >&2
|
|
55
|
-
echo " npm install ${
|
|
49
|
+
echo " npm install ${BIN%%/*}" >&2
|
|
56
50
|
exit 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "csskit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Refreshing CSS",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"./bin"
|
|
12
12
|
],
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"csskit-linux-x64": "0.0.
|
|
15
|
-
"csskit-linux-arm64": "0.0.
|
|
16
|
-
"csskit-darwin-x64": "0.0.
|
|
17
|
-
"csskit-darwin-arm64": "0.0.
|
|
18
|
-
"csskit-win32-x64": "0.0.
|
|
19
|
-
"csskit-win32-arm64": "0.0.
|
|
14
|
+
"csskit-linux-x64": "0.0.12",
|
|
15
|
+
"csskit-linux-arm64": "0.0.12",
|
|
16
|
+
"csskit-darwin-x64": "0.0.12",
|
|
17
|
+
"csskit-darwin-arm64": "0.0.12",
|
|
18
|
+
"csskit-win32-x64": "0.0.12",
|
|
19
|
+
"csskit-win32-arm64": "0.0.12"
|
|
20
20
|
},
|
|
21
21
|
"funding": {
|
|
22
22
|
"url": "https://github.com/sponsors/keithamus"
|